squad-kit 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,416 @@
1
+ function EW(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Jo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pD={exports:{}},xv={},mD={exports:{}},Ee={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Bd=Symbol.for("react.element"),TW=Symbol.for("react.portal"),_W=Symbol.for("react.fragment"),MW=Symbol.for("react.strict_mode"),IW=Symbol.for("react.profiler"),jW=Symbol.for("react.provider"),RW=Symbol.for("react.context"),NW=Symbol.for("react.forward_ref"),DW=Symbol.for("react.suspense"),LW=Symbol.for("react.memo"),$W=Symbol.for("react.lazy"),ZP=Symbol.iterator;function BW(e){return e===null||typeof e!="object"?null:(e=ZP&&e[ZP]||e["@@iterator"],typeof e=="function"?e:null)}var gD={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yD=Object.assign,vD={};function yc(e,t,n){this.props=e,this.context=t,this.refs=vD,this.updater=n||gD}yc.prototype.isReactComponent={};yc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bD(){}bD.prototype=yc.prototype;function AO(e,t,n){this.props=e,this.context=t,this.refs=vD,this.updater=n||gD}var PO=AO.prototype=new bD;PO.constructor=AO;yD(PO,yc.prototype);PO.isPureReactComponent=!0;var JP=Array.isArray,xD=Object.prototype.hasOwnProperty,EO={current:null},wD={key:!0,ref:!0,__self:!0,__source:!0};function SD(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)xD.call(t,r)&&!wD.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Bd,type:e,key:o,ref:s,props:i,_owner:EO.current}}function FW(e,t){return{$$typeof:Bd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function TO(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bd}function zW(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var eE=/\/+/g;function ub(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zW(""+e.key):t.toString(36)}function Om(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Bd:case TW:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+ub(s,0):r,JP(i)?(n="",e!=null&&(n=e.replace(eE,"$&/")+"/"),Om(i,t,n,"",function(u){return u})):i!=null&&(TO(i)&&(i=FW(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(eE,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",JP(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+ub(o,a);s+=Om(o,t,n,l,i)}else if(l=BW(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+ub(o,a++),s+=Om(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function fp(e,t,n){if(e==null)return e;var r=[],i=0;return Om(e,r,"","",function(o){return t.call(n,o,i++)}),r}function WW(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Dn={current:null},Cm={transition:null},UW={ReactCurrentDispatcher:Dn,ReactCurrentBatchConfig:Cm,ReactCurrentOwner:EO};function kD(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:fp,forEach:function(e,t,n){fp(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return fp(e,function(){t++}),t},toArray:function(e){return fp(e,function(t){return t})||[]},only:function(e){if(!TO(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ee.Component=yc;Ee.Fragment=_W;Ee.Profiler=IW;Ee.PureComponent=AO;Ee.StrictMode=MW;Ee.Suspense=DW;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UW;Ee.act=kD;Ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=yD({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=EO.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)xD.call(t,l)&&!wD.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Bd,type:e.type,key:i,ref:o,props:r,_owner:s}};Ee.createContext=function(e){return e={$$typeof:RW,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jW,_context:e},e.Consumer=e};Ee.createElement=SD;Ee.createFactory=function(e){var t=SD.bind(null,e);return t.type=e,t};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(e){return{$$typeof:NW,render:e}};Ee.isValidElement=TO;Ee.lazy=function(e){return{$$typeof:$W,_payload:{_status:-1,_result:e},_init:WW}};Ee.memo=function(e,t){return{$$typeof:LW,type:e,compare:t===void 0?null:t}};Ee.startTransition=function(e){var t=Cm.transition;Cm.transition={};try{e()}finally{Cm.transition=t}};Ee.unstable_act=kD;Ee.useCallback=function(e,t){return Dn.current.useCallback(e,t)};Ee.useContext=function(e){return Dn.current.useContext(e)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(e){return Dn.current.useDeferredValue(e)};Ee.useEffect=function(e,t){return Dn.current.useEffect(e,t)};Ee.useId=function(){return Dn.current.useId()};Ee.useImperativeHandle=function(e,t,n){return Dn.current.useImperativeHandle(e,t,n)};Ee.useInsertionEffect=function(e,t){return Dn.current.useInsertionEffect(e,t)};Ee.useLayoutEffect=function(e,t){return Dn.current.useLayoutEffect(e,t)};Ee.useMemo=function(e,t){return Dn.current.useMemo(e,t)};Ee.useReducer=function(e,t,n){return Dn.current.useReducer(e,t,n)};Ee.useRef=function(e){return Dn.current.useRef(e)};Ee.useState=function(e){return Dn.current.useState(e)};Ee.useSyncExternalStore=function(e,t,n){return Dn.current.useSyncExternalStore(e,t,n)};Ee.useTransition=function(){return Dn.current.useTransition()};Ee.version="18.3.1";mD.exports=Ee;var C=mD.exports;const L=De(C),_O=EW({__proto__:null,default:L},[C]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var HW=C,VW=Symbol.for("react.element"),qW=Symbol.for("react.fragment"),KW=Object.prototype.hasOwnProperty,GW=HW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,QW={key:!0,ref:!0,__self:!0,__source:!0};function OD(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)KW.call(t,r)&&!QW.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:VW,type:e,key:o,ref:s,props:i,_owner:GW.current}}xv.Fragment=qW;xv.jsx=OD;xv.jsxs=OD;pD.exports=xv;var b=pD.exports,CD={exports:{}},Cr={},AD={exports:{}},PD={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t($,z){var T=$.length;$.push(z);e:for(;0<T;){var q=T-1>>>1,D=$[q];if(0<i(D,z))$[q]=z,$[T]=D,T=q;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var z=$[0],T=$.pop();if(T!==z){$[0]=T;e:for(var q=0,D=$.length,I=D>>>1;q<I;){var Y=2*(q+1)-1,G=$[Y],te=Y+1,fe=$[te];if(0>i(G,T))te<D&&0>i(fe,G)?($[q]=fe,$[te]=T,q=te):($[q]=G,$[Y]=T,q=Y);else if(te<D&&0>i(fe,T))$[q]=fe,$[te]=T,q=te;else break e}}return z}function i($,z){var T=$.sortIndex-z.sortIndex;return T!==0?T:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,f=null,h=3,d=!1,p=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x($){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=$)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function k($){if(m=!1,x($),!p)if(n(l)!==null)p=!0,B(w);else{var z=n(u);z!==null&&F(k,z.startTime-$)}}function w($,z){p=!1,m&&(m=!1,g(A),A=-1),d=!0;var T=h;try{for(x(z),f=n(l);f!==null&&(!(f.expirationTime>z)||$&&!_());){var q=f.callback;if(typeof q=="function"){f.callback=null,h=f.priorityLevel;var D=q(f.expirationTime<=z);z=e.unstable_now(),typeof D=="function"?f.callback=D:f===n(l)&&r(l),x(z)}else r(l);f=n(l)}if(f!==null)var I=!0;else{var Y=n(u);Y!==null&&F(k,Y.startTime-z),I=!1}return I}finally{f=null,h=T,d=!1}}var S=!1,O=null,A=-1,P=5,M=-1;function _(){return!(e.unstable_now()-M<P)}function E(){if(O!==null){var $=e.unstable_now();M=$;var z=!0;try{z=O(!0,$)}finally{z?R():(S=!1,O=null)}}else S=!1}var R;if(typeof v=="function")R=function(){v(E)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,j=N.port2;N.port1.onmessage=E,R=function(){j.postMessage(null)}}else R=function(){y(E,0)};function B($){O=$,S||(S=!0,R())}function F($,z){A=y(function(){$(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){p||d||(p=!0,B(w))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function($){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var T=h;h=z;try{return $()}finally{h=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var T=h;h=$;try{return z()}finally{h=T}},e.unstable_scheduleCallback=function($,z,T){var q=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?q+T:q):T=q,$){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=T+D,$={id:c++,callback:z,priorityLevel:$,startTime:T,expirationTime:D,sortIndex:-1},T>q?($.sortIndex=T,t(u,$),n(l)===null&&$===n(u)&&(m?(g(A),A=-1):m=!0,F(k,T-q))):($.sortIndex=D,t(l,$),p||d||(p=!0,B(w))),$},e.unstable_shouldYield=_,e.unstable_wrapCallback=function($){var z=h;return function(){var T=h;h=z;try{return $.apply(this,arguments)}finally{h=T}}}})(PD);AD.exports=PD;var XW=AD.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var YW=C,Or=XW;function Z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ED=new Set,ch={};function el(e,t){Cu(e,t),Cu(e+"Capture",t)}function Cu(e,t){for(ch[e]=t,e=0;e<t.length;e++)ED.add(t[e])}var So=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),C1=Object.prototype.hasOwnProperty,ZW=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,tE={},nE={};function JW(e){return C1.call(nE,e)?!0:C1.call(tE,e)?!1:ZW.test(e)?nE[e]=!0:(tE[e]=!0,!1)}function eU(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tU(e,t,n,r){if(t===null||typeof t>"u"||eU(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ln(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new Ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new Ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new Ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new Ln(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){hn[e]=new Ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new Ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new Ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new Ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new Ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var MO=/[\-:]([a-z])/g;function IO(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(MO,IO);hn[t]=new Ln(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(MO,IO);hn[t]=new Ln(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(MO,IO);hn[t]=new Ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new Ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function jO(e,t,n,r){var i=hn.hasOwnProperty(t)?hn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(tU(t,n,i,r)&&(n=null),r||i===null?JW(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ro=YW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hp=Symbol.for("react.element"),Nl=Symbol.for("react.portal"),Dl=Symbol.for("react.fragment"),RO=Symbol.for("react.strict_mode"),A1=Symbol.for("react.profiler"),TD=Symbol.for("react.provider"),_D=Symbol.for("react.context"),NO=Symbol.for("react.forward_ref"),P1=Symbol.for("react.suspense"),E1=Symbol.for("react.suspense_list"),DO=Symbol.for("react.memo"),Ho=Symbol.for("react.lazy"),MD=Symbol.for("react.offscreen"),rE=Symbol.iterator;function Hc(e){return e===null||typeof e!="object"?null:(e=rE&&e[rE]||e["@@iterator"],typeof e=="function"?e:null)}var bt=Object.assign,cb;function Cf(e){if(cb===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);cb=t&&t[1]||""}return`
34
+ `+cb+e}var fb=!1;function hb(e,t){if(!e||fb)return"";fb=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
37
+ `+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{fb=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cf(e):""}function nU(e){switch(e.tag){case 5:return Cf(e.type);case 16:return Cf("Lazy");case 13:return Cf("Suspense");case 19:return Cf("SuspenseList");case 0:case 2:case 15:return e=hb(e.type,!1),e;case 11:return e=hb(e.type.render,!1),e;case 1:return e=hb(e.type,!0),e;default:return""}}function T1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Dl:return"Fragment";case Nl:return"Portal";case A1:return"Profiler";case RO:return"StrictMode";case P1:return"Suspense";case E1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _D:return(e.displayName||"Context")+".Consumer";case TD:return(e._context.displayName||"Context")+".Provider";case NO:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case DO:return t=e.displayName||null,t!==null?t:T1(e.type)||"Memo";case Ho:t=e._payload,e=e._init;try{return T1(e(t))}catch{}}return null}function rU(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return T1(t);case 8:return t===RO?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ks(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ID(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iU(e){var t=ID(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dp(e){e._valueTracker||(e._valueTracker=iU(e))}function jD(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ID(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function eg(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _1(e,t){var n=t.checked;return bt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function iE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ks(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function RD(e,t){t=t.checked,t!=null&&jO(e,"checked",t,!1)}function M1(e,t){RD(e,t);var n=ks(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?I1(e,t.type,n):t.hasOwnProperty("defaultValue")&&I1(e,t.type,ks(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function oE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function I1(e,t,n){(t!=="number"||eg(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Af=Array.isArray;function iu(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ks(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function j1(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Z(91));return bt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function sE(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Z(92));if(Af(n)){if(1<n.length)throw Error(Z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ks(n)}}function ND(e,t){var n=ks(t.value),r=ks(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function aE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function DD(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function R1(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?DD(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var pp,LD=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(pp=pp||document.createElement("div"),pp.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=pp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fh(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oU=["Webkit","ms","Moz","O"];Object.keys(Nf).forEach(function(e){oU.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nf[t]=Nf[e]})});function $D(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Nf.hasOwnProperty(e)&&Nf[e]?(""+t).trim():t+"px"}function BD(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=$D(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var sU=bt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function N1(e,t){if(t){if(sU[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function D1(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var L1=null;function LO(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $1=null,ou=null,su=null;function lE(e){if(e=Wd(e)){if(typeof $1!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=Cv(t),$1(e.stateNode,e.type,t))}}function FD(e){ou?su?su.push(e):su=[e]:ou=e}function zD(){if(ou){var e=ou,t=su;if(su=ou=null,lE(e),t)for(e=0;e<t.length;e++)lE(t[e])}}function WD(e,t){return e(t)}function UD(){}var db=!1;function HD(e,t,n){if(db)return e(t,n);db=!0;try{return WD(e,t,n)}finally{db=!1,(ou!==null||su!==null)&&(UD(),zD())}}function hh(e,t){var n=e.stateNode;if(n===null)return null;var r=Cv(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Z(231,t,typeof n));return n}var B1=!1;if(So)try{var Vc={};Object.defineProperty(Vc,"passive",{get:function(){B1=!0}}),window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch{B1=!1}function aU(e,t,n,r,i,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Df=!1,tg=null,ng=!1,F1=null,lU={onError:function(e){Df=!0,tg=e}};function uU(e,t,n,r,i,o,s,a,l){Df=!1,tg=null,aU.apply(lU,arguments)}function cU(e,t,n,r,i,o,s,a,l){if(uU.apply(this,arguments),Df){if(Df){var u=tg;Df=!1,tg=null}else throw Error(Z(198));ng||(ng=!0,F1=u)}}function tl(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function VD(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function uE(e){if(tl(e)!==e)throw Error(Z(188))}function fU(e){var t=e.alternate;if(!t){if(t=tl(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return uE(i),e;if(o===r)return uE(i),t;o=o.sibling}throw Error(Z(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(Z(189))}}if(n.alternate!==r)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function qD(e){return e=fU(e),e!==null?KD(e):null}function KD(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=KD(e);if(t!==null)return t;e=e.sibling}return null}var GD=Or.unstable_scheduleCallback,cE=Or.unstable_cancelCallback,hU=Or.unstable_shouldYield,dU=Or.unstable_requestPaint,Pt=Or.unstable_now,pU=Or.unstable_getCurrentPriorityLevel,$O=Or.unstable_ImmediatePriority,QD=Or.unstable_UserBlockingPriority,rg=Or.unstable_NormalPriority,mU=Or.unstable_LowPriority,XD=Or.unstable_IdlePriority,wv=null,$i=null;function gU(e){if($i&&typeof $i.onCommitFiberRoot=="function")try{$i.onCommitFiberRoot(wv,e,void 0,(e.current.flags&128)===128)}catch{}}var fi=Math.clz32?Math.clz32:bU,yU=Math.log,vU=Math.LN2;function bU(e){return e>>>=0,e===0?32:31-(yU(e)/vU|0)|0}var mp=64,gp=4194304;function Pf(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ig(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=Pf(a):(o&=s,o!==0&&(r=Pf(o)))}else s=n&~i,s!==0?r=Pf(s):o!==0&&(r=Pf(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-fi(t),i=1<<n,r|=e[n],t&=~i;return r}function xU(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wU(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-fi(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=xU(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function z1(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function YD(){var e=mp;return mp<<=1,!(mp&4194240)&&(mp=64),e}function pb(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Fd(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fi(t),e[t]=n}function SU(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-fi(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function BO(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-fi(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ze=0;function ZD(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var JD,FO,eL,tL,nL,W1=!1,yp=[],ls=null,us=null,cs=null,dh=new Map,ph=new Map,Xo=[],kU="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fE(e,t){switch(e){case"focusin":case"focusout":ls=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":cs=null;break;case"pointerover":case"pointerout":dh.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ph.delete(t.pointerId)}}function qc(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Wd(t),t!==null&&FO(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function OU(e,t,n,r,i){switch(t){case"focusin":return ls=qc(ls,e,t,n,r,i),!0;case"dragenter":return us=qc(us,e,t,n,r,i),!0;case"mouseover":return cs=qc(cs,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return dh.set(o,qc(dh.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,ph.set(o,qc(ph.get(o)||null,e,t,n,r,i)),!0}return!1}function rL(e){var t=fa(e.target);if(t!==null){var n=tl(t);if(n!==null){if(t=n.tag,t===13){if(t=VD(n),t!==null){e.blockedOn=t,nL(e.priority,function(){eL(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Am(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=U1(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);L1=r,n.target.dispatchEvent(r),L1=null}else return t=Wd(n),t!==null&&FO(t),e.blockedOn=n,!1;t.shift()}return!0}function hE(e,t,n){Am(e)&&n.delete(t)}function CU(){W1=!1,ls!==null&&Am(ls)&&(ls=null),us!==null&&Am(us)&&(us=null),cs!==null&&Am(cs)&&(cs=null),dh.forEach(hE),ph.forEach(hE)}function Kc(e,t){e.blockedOn===t&&(e.blockedOn=null,W1||(W1=!0,Or.unstable_scheduleCallback(Or.unstable_NormalPriority,CU)))}function mh(e){function t(i){return Kc(i,e)}if(0<yp.length){Kc(yp[0],e);for(var n=1;n<yp.length;n++){var r=yp[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ls!==null&&Kc(ls,e),us!==null&&Kc(us,e),cs!==null&&Kc(cs,e),dh.forEach(t),ph.forEach(t),n=0;n<Xo.length;n++)r=Xo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Xo.length&&(n=Xo[0],n.blockedOn===null);)rL(n),n.blockedOn===null&&Xo.shift()}var au=Ro.ReactCurrentBatchConfig,og=!0;function AU(e,t,n,r){var i=ze,o=au.transition;au.transition=null;try{ze=1,zO(e,t,n,r)}finally{ze=i,au.transition=o}}function PU(e,t,n,r){var i=ze,o=au.transition;au.transition=null;try{ze=4,zO(e,t,n,r)}finally{ze=i,au.transition=o}}function zO(e,t,n,r){if(og){var i=U1(e,t,n,r);if(i===null)Ob(e,t,r,sg,n),fE(e,r);else if(OU(i,e,t,n,r))r.stopPropagation();else if(fE(e,r),t&4&&-1<kU.indexOf(e)){for(;i!==null;){var o=Wd(i);if(o!==null&&JD(o),o=U1(e,t,n,r),o===null&&Ob(e,t,r,sg,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Ob(e,t,r,null,n)}}var sg=null;function U1(e,t,n,r){if(sg=null,e=LO(r),e=fa(e),e!==null)if(t=tl(e),t===null)e=null;else if(n=t.tag,n===13){if(e=VD(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return sg=e,null}function iL(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pU()){case $O:return 1;case QD:return 4;case rg:case mU:return 16;case XD:return 536870912;default:return 16}default:return 16}}var es=null,WO=null,Pm=null;function oL(){if(Pm)return Pm;var e,t=WO,n=t.length,r,i="value"in es?es.value:es.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return Pm=i.slice(e,1<r?1-r:void 0)}function Em(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vp(){return!0}function dE(){return!1}function Ar(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?vp:dE,this.isPropagationStopped=dE,this}return bt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=vp)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vp)},persist:function(){},isPersistent:vp}),t}var vc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},UO=Ar(vc),zd=bt({},vc,{view:0,detail:0}),EU=Ar(zd),mb,gb,Gc,Sv=bt({},zd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:HO,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gc&&(Gc&&e.type==="mousemove"?(mb=e.screenX-Gc.screenX,gb=e.screenY-Gc.screenY):gb=mb=0,Gc=e),mb)},movementY:function(e){return"movementY"in e?e.movementY:gb}}),pE=Ar(Sv),TU=bt({},Sv,{dataTransfer:0}),_U=Ar(TU),MU=bt({},zd,{relatedTarget:0}),yb=Ar(MU),IU=bt({},vc,{animationName:0,elapsedTime:0,pseudoElement:0}),jU=Ar(IU),RU=bt({},vc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),NU=Ar(RU),DU=bt({},vc,{data:0}),mE=Ar(DU),LU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$U={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},BU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FU(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BU[e])?!!t[e]:!1}function HO(){return FU}var zU=bt({},zd,{key:function(e){if(e.key){var t=LU[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Em(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$U[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:HO,charCode:function(e){return e.type==="keypress"?Em(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Em(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WU=Ar(zU),UU=bt({},Sv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gE=Ar(UU),HU=bt({},zd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:HO}),VU=Ar(HU),qU=bt({},vc,{propertyName:0,elapsedTime:0,pseudoElement:0}),KU=Ar(qU),GU=bt({},Sv,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),QU=Ar(GU),XU=[9,13,27,32],VO=So&&"CompositionEvent"in window,Lf=null;So&&"documentMode"in document&&(Lf=document.documentMode);var YU=So&&"TextEvent"in window&&!Lf,sL=So&&(!VO||Lf&&8<Lf&&11>=Lf),yE=" ",vE=!1;function aL(e,t){switch(e){case"keyup":return XU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lL(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ll=!1;function ZU(e,t){switch(e){case"compositionend":return lL(t);case"keypress":return t.which!==32?null:(vE=!0,yE);case"textInput":return e=t.data,e===yE&&vE?null:e;default:return null}}function JU(e,t){if(Ll)return e==="compositionend"||!VO&&aL(e,t)?(e=oL(),Pm=WO=es=null,Ll=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sL&&t.locale!=="ko"?null:t.data;default:return null}}var eH={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function bE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!eH[e.type]:t==="textarea"}function uL(e,t,n,r){FD(r),t=ag(t,"onChange"),0<t.length&&(n=new UO("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $f=null,gh=null;function tH(e){xL(e,0)}function kv(e){var t=Fl(e);if(jD(t))return e}function nH(e,t){if(e==="change")return t}var cL=!1;if(So){var vb;if(So){var bb="oninput"in document;if(!bb){var xE=document.createElement("div");xE.setAttribute("oninput","return;"),bb=typeof xE.oninput=="function"}vb=bb}else vb=!1;cL=vb&&(!document.documentMode||9<document.documentMode)}function wE(){$f&&($f.detachEvent("onpropertychange",fL),gh=$f=null)}function fL(e){if(e.propertyName==="value"&&kv(gh)){var t=[];uL(t,gh,e,LO(e)),HD(tH,t)}}function rH(e,t,n){e==="focusin"?(wE(),$f=t,gh=n,$f.attachEvent("onpropertychange",fL)):e==="focusout"&&wE()}function iH(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kv(gh)}function oH(e,t){if(e==="click")return kv(t)}function sH(e,t){if(e==="input"||e==="change")return kv(t)}function aH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var di=typeof Object.is=="function"?Object.is:aH;function yh(e,t){if(di(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!C1.call(t,i)||!di(e[i],t[i]))return!1}return!0}function SE(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kE(e,t){var n=SE(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=SE(n)}}function hL(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hL(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dL(){for(var e=window,t=eg();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=eg(e.document)}return t}function qO(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function lH(e){var t=dL(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hL(n.ownerDocument.documentElement,n)){if(r!==null&&qO(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=kE(n,o);var s=kE(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uH=So&&"documentMode"in document&&11>=document.documentMode,$l=null,H1=null,Bf=null,V1=!1;function OE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;V1||$l==null||$l!==eg(r)||(r=$l,"selectionStart"in r&&qO(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bf&&yh(Bf,r)||(Bf=r,r=ag(H1,"onSelect"),0<r.length&&(t=new UO("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=$l)))}function bp(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Bl={animationend:bp("Animation","AnimationEnd"),animationiteration:bp("Animation","AnimationIteration"),animationstart:bp("Animation","AnimationStart"),transitionend:bp("Transition","TransitionEnd")},xb={},pL={};So&&(pL=document.createElement("div").style,"AnimationEvent"in window||(delete Bl.animationend.animation,delete Bl.animationiteration.animation,delete Bl.animationstart.animation),"TransitionEvent"in window||delete Bl.transitionend.transition);function Ov(e){if(xb[e])return xb[e];if(!Bl[e])return e;var t=Bl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pL)return xb[e]=t[n];return e}var mL=Ov("animationend"),gL=Ov("animationiteration"),yL=Ov("animationstart"),vL=Ov("transitionend"),bL=new Map,CE="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ns(e,t){bL.set(e,t),el(t,[e])}for(var wb=0;wb<CE.length;wb++){var Sb=CE[wb],cH=Sb.toLowerCase(),fH=Sb[0].toUpperCase()+Sb.slice(1);Ns(cH,"on"+fH)}Ns(mL,"onAnimationEnd");Ns(gL,"onAnimationIteration");Ns(yL,"onAnimationStart");Ns("dblclick","onDoubleClick");Ns("focusin","onFocus");Ns("focusout","onBlur");Ns(vL,"onTransitionEnd");Cu("onMouseEnter",["mouseout","mouseover"]);Cu("onMouseLeave",["mouseout","mouseover"]);Cu("onPointerEnter",["pointerout","pointerover"]);Cu("onPointerLeave",["pointerout","pointerover"]);el("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));el("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));el("onBeforeInput",["compositionend","keypress","textInput","paste"]);el("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));el("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));el("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ef="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ef));function AE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,cU(r,t,void 0,e),e.currentTarget=null}function xL(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;AE(i,a,u),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;AE(i,a,u),o=l}}}if(ng)throw e=F1,ng=!1,F1=null,e}function at(e,t){var n=t[X1];n===void 0&&(n=t[X1]=new Set);var r=e+"__bubble";n.has(r)||(wL(t,e,2,!1),n.add(r))}function kb(e,t,n){var r=0;t&&(r|=4),wL(n,e,r,t)}var xp="_reactListening"+Math.random().toString(36).slice(2);function vh(e){if(!e[xp]){e[xp]=!0,ED.forEach(function(n){n!=="selectionchange"&&(hH.has(n)||kb(n,!1,e),kb(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xp]||(t[xp]=!0,kb("selectionchange",!1,t))}}function wL(e,t,n,r){switch(iL(t)){case 1:var i=AU;break;case 4:i=PU;break;default:i=zO}n=i.bind(null,t,n,e),i=void 0,!B1||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ob(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=fa(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}HD(function(){var u=o,c=LO(n),f=[];e:{var h=bL.get(e);if(h!==void 0){var d=UO,p=e;switch(e){case"keypress":if(Em(n)===0)break e;case"keydown":case"keyup":d=WU;break;case"focusin":p="focus",d=yb;break;case"focusout":p="blur",d=yb;break;case"beforeblur":case"afterblur":d=yb;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=pE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=_U;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=VU;break;case mL:case gL:case yL:d=jU;break;case vL:d=KU;break;case"scroll":d=EU;break;case"wheel":d=QU;break;case"copy":case"cut":case"paste":d=NU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=gE}var m=(t&4)!==0,y=!m&&e==="scroll",g=m?h!==null?h+"Capture":null:h;m=[];for(var v=u,x;v!==null;){x=v;var k=x.stateNode;if(x.tag===5&&k!==null&&(x=k,g!==null&&(k=hh(v,g),k!=null&&m.push(bh(v,k,x)))),y)break;v=v.return}0<m.length&&(h=new d(h,p,null,n,c),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",h&&n!==L1&&(p=n.relatedTarget||n.fromElement)&&(fa(p)||p[ko]))break e;if((d||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=u,p=p?fa(p):null,p!==null&&(y=tl(p),p!==y||p.tag!==5&&p.tag!==6)&&(p=null)):(d=null,p=u),d!==p)){if(m=pE,k="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=gE,k="onPointerLeave",g="onPointerEnter",v="pointer"),y=d==null?h:Fl(d),x=p==null?h:Fl(p),h=new m(k,v+"leave",d,n,c),h.target=y,h.relatedTarget=x,k=null,fa(c)===u&&(m=new m(g,v+"enter",p,n,c),m.target=x,m.relatedTarget=y,k=m),y=k,d&&p)t:{for(m=d,g=p,v=0,x=m;x;x=gl(x))v++;for(x=0,k=g;k;k=gl(k))x++;for(;0<v-x;)m=gl(m),v--;for(;0<x-v;)g=gl(g),x--;for(;v--;){if(m===g||g!==null&&m===g.alternate)break t;m=gl(m),g=gl(g)}m=null}else m=null;d!==null&&PE(f,h,d,m,!1),p!==null&&y!==null&&PE(f,y,p,m,!0)}}e:{if(h=u?Fl(u):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var w=nH;else if(bE(h))if(cL)w=sH;else{w=iH;var S=rH}else(d=h.nodeName)&&d.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=oH);if(w&&(w=w(e,u))){uL(f,w,n,c);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&I1(h,"number",h.value)}switch(S=u?Fl(u):window,e){case"focusin":(bE(S)||S.contentEditable==="true")&&($l=S,H1=u,Bf=null);break;case"focusout":Bf=H1=$l=null;break;case"mousedown":V1=!0;break;case"contextmenu":case"mouseup":case"dragend":V1=!1,OE(f,n,c);break;case"selectionchange":if(uH)break;case"keydown":case"keyup":OE(f,n,c)}var O;if(VO)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Ll?aL(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(sL&&n.locale!=="ko"&&(Ll||A!=="onCompositionStart"?A==="onCompositionEnd"&&Ll&&(O=oL()):(es=c,WO="value"in es?es.value:es.textContent,Ll=!0)),S=ag(u,A),0<S.length&&(A=new mE(A,e,null,n,c),f.push({event:A,listeners:S}),O?A.data=O:(O=lL(n),O!==null&&(A.data=O)))),(O=YU?ZU(e,n):JU(e,n))&&(u=ag(u,"onBeforeInput"),0<u.length&&(c=new mE("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=O))}xL(f,t)})}function bh(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ag(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=hh(e,n),o!=null&&r.unshift(bh(e,o,i)),o=hh(e,t),o!=null&&r.push(bh(e,o,i))),e=e.return}return r}function gl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function PE(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=hh(n,o),l!=null&&s.unshift(bh(n,l,a))):i||(l=hh(n,o),l!=null&&s.push(bh(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var dH=/\r\n?/g,pH=/\u0000|\uFFFD/g;function EE(e){return(typeof e=="string"?e:""+e).replace(dH,`
38
+ `).replace(pH,"")}function wp(e,t,n){if(t=EE(t),EE(e)!==t&&n)throw Error(Z(425))}function lg(){}var q1=null,K1=null;function G1(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Q1=typeof setTimeout=="function"?setTimeout:void 0,mH=typeof clearTimeout=="function"?clearTimeout:void 0,TE=typeof Promise=="function"?Promise:void 0,gH=typeof queueMicrotask=="function"?queueMicrotask:typeof TE<"u"?function(e){return TE.resolve(null).then(e).catch(yH)}:Q1;function yH(e){setTimeout(function(){throw e})}function Cb(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),mh(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);mh(t)}function fs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function _E(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var bc=Math.random().toString(36).slice(2),Ei="__reactFiber$"+bc,xh="__reactProps$"+bc,ko="__reactContainer$"+bc,X1="__reactEvents$"+bc,vH="__reactListeners$"+bc,bH="__reactHandles$"+bc;function fa(e){var t=e[Ei];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ko]||n[Ei]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_E(e);e!==null;){if(n=e[Ei])return n;e=_E(e)}return t}e=n,n=e.parentNode}return null}function Wd(e){return e=e[Ei]||e[ko],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Z(33))}function Cv(e){return e[xh]||null}var Y1=[],zl=-1;function Ds(e){return{current:e}}function ft(e){0>zl||(e.current=Y1[zl],Y1[zl]=null,zl--)}function rt(e,t){zl++,Y1[zl]=e.current,e.current=t}var Os={},bn=Ds(Os),Qn=Ds(!1),Da=Os;function Au(e,t){var n=e.type.contextTypes;if(!n)return Os;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Xn(e){return e=e.childContextTypes,e!=null}function ug(){ft(Qn),ft(bn)}function ME(e,t,n){if(bn.current!==Os)throw Error(Z(168));rt(bn,t),rt(Qn,n)}function SL(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Z(108,rU(e)||"Unknown",i));return bt({},n,r)}function cg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Os,Da=bn.current,rt(bn,e),rt(Qn,Qn.current),!0}function IE(e,t,n){var r=e.stateNode;if(!r)throw Error(Z(169));n?(e=SL(e,t,Da),r.__reactInternalMemoizedMergedChildContext=e,ft(Qn),ft(bn),rt(bn,e)):ft(Qn),rt(Qn,n)}var oo=null,Av=!1,Ab=!1;function kL(e){oo===null?oo=[e]:oo.push(e)}function xH(e){Av=!0,kL(e)}function Ls(){if(!Ab&&oo!==null){Ab=!0;var e=0,t=ze;try{var n=oo;for(ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}oo=null,Av=!1}catch(i){throw oo!==null&&(oo=oo.slice(e+1)),GD($O,Ls),i}finally{ze=t,Ab=!1}}return null}var Wl=[],Ul=0,fg=null,hg=0,Ir=[],jr=0,La=null,uo=1,co="";function ea(e,t){Wl[Ul++]=hg,Wl[Ul++]=fg,fg=e,hg=t}function OL(e,t,n){Ir[jr++]=uo,Ir[jr++]=co,Ir[jr++]=La,La=e;var r=uo;e=co;var i=32-fi(r)-1;r&=~(1<<i),n+=1;var o=32-fi(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,uo=1<<32-fi(t)+i|n<<i|r,co=o+e}else uo=1<<o|n<<i|r,co=e}function KO(e){e.return!==null&&(ea(e,1),OL(e,1,0))}function GO(e){for(;e===fg;)fg=Wl[--Ul],Wl[Ul]=null,hg=Wl[--Ul],Wl[Ul]=null;for(;e===La;)La=Ir[--jr],Ir[jr]=null,co=Ir[--jr],Ir[jr]=null,uo=Ir[--jr],Ir[jr]=null}var wr=null,vr=null,pt=!1,si=null;function CL(e,t){var n=Lr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function jE(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wr=e,vr=fs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wr=e,vr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=La!==null?{id:uo,overflow:co}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Lr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wr=e,vr=null,!0):!1;default:return!1}}function Z1(e){return(e.mode&1)!==0&&(e.flags&128)===0}function J1(e){if(pt){var t=vr;if(t){var n=t;if(!jE(e,t)){if(Z1(e))throw Error(Z(418));t=fs(n.nextSibling);var r=wr;t&&jE(e,t)?CL(r,n):(e.flags=e.flags&-4097|2,pt=!1,wr=e)}}else{if(Z1(e))throw Error(Z(418));e.flags=e.flags&-4097|2,pt=!1,wr=e}}}function RE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wr=e}function Sp(e){if(e!==wr)return!1;if(!pt)return RE(e),pt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!G1(e.type,e.memoizedProps)),t&&(t=vr)){if(Z1(e))throw AL(),Error(Z(418));for(;t;)CL(e,t),t=fs(t.nextSibling)}if(RE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){vr=fs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}vr=null}}else vr=wr?fs(e.stateNode.nextSibling):null;return!0}function AL(){for(var e=vr;e;)e=fs(e.nextSibling)}function Pu(){vr=wr=null,pt=!1}function QO(e){si===null?si=[e]:si.push(e)}var wH=Ro.ReactCurrentBatchConfig;function Qc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Z(309));var r=n.stateNode}if(!r)throw Error(Z(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(Z(284));if(!n._owner)throw Error(Z(290,e))}return e}function kp(e,t){throw e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function NE(e){var t=e._init;return t(e._payload)}function PL(e){function t(g,v){if(e){var x=g.deletions;x===null?(g.deletions=[v],g.flags|=16):x.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function i(g,v){return g=ms(g,v),g.index=0,g.sibling=null,g}function o(g,v,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<v?(g.flags|=2,v):x):(g.flags|=2,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,v,x,k){return v===null||v.tag!==6?(v=jb(x,g.mode,k),v.return=g,v):(v=i(v,x),v.return=g,v)}function l(g,v,x,k){var w=x.type;return w===Dl?c(g,v,x.props.children,k,x.key):v!==null&&(v.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ho&&NE(w)===v.type)?(k=i(v,x.props),k.ref=Qc(g,v,x),k.return=g,k):(k=Nm(x.type,x.key,x.props,null,g.mode,k),k.ref=Qc(g,v,x),k.return=g,k)}function u(g,v,x,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=Rb(x,g.mode,k),v.return=g,v):(v=i(v,x.children||[]),v.return=g,v)}function c(g,v,x,k,w){return v===null||v.tag!==7?(v=Aa(x,g.mode,k,w),v.return=g,v):(v=i(v,x),v.return=g,v)}function f(g,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=jb(""+v,g.mode,x),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case hp:return x=Nm(v.type,v.key,v.props,null,g.mode,x),x.ref=Qc(g,null,v),x.return=g,x;case Nl:return v=Rb(v,g.mode,x),v.return=g,v;case Ho:var k=v._init;return f(g,k(v._payload),x)}if(Af(v)||Hc(v))return v=Aa(v,g.mode,x,null),v.return=g,v;kp(g,v)}return null}function h(g,v,x,k){var w=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return w!==null?null:a(g,v,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case hp:return x.key===w?l(g,v,x,k):null;case Nl:return x.key===w?u(g,v,x,k):null;case Ho:return w=x._init,h(g,v,w(x._payload),k)}if(Af(x)||Hc(x))return w!==null?null:c(g,v,x,k,null);kp(g,x)}return null}function d(g,v,x,k,w){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(x)||null,a(v,g,""+k,w);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case hp:return g=g.get(k.key===null?x:k.key)||null,l(v,g,k,w);case Nl:return g=g.get(k.key===null?x:k.key)||null,u(v,g,k,w);case Ho:var S=k._init;return d(g,v,x,S(k._payload),w)}if(Af(k)||Hc(k))return g=g.get(x)||null,c(v,g,k,w,null);kp(v,k)}return null}function p(g,v,x,k){for(var w=null,S=null,O=v,A=v=0,P=null;O!==null&&A<x.length;A++){O.index>A?(P=O,O=null):P=O.sibling;var M=h(g,O,x[A],k);if(M===null){O===null&&(O=P);break}e&&O&&M.alternate===null&&t(g,O),v=o(M,v,A),S===null?w=M:S.sibling=M,S=M,O=P}if(A===x.length)return n(g,O),pt&&ea(g,A),w;if(O===null){for(;A<x.length;A++)O=f(g,x[A],k),O!==null&&(v=o(O,v,A),S===null?w=O:S.sibling=O,S=O);return pt&&ea(g,A),w}for(O=r(g,O);A<x.length;A++)P=d(O,g,A,x[A],k),P!==null&&(e&&P.alternate!==null&&O.delete(P.key===null?A:P.key),v=o(P,v,A),S===null?w=P:S.sibling=P,S=P);return e&&O.forEach(function(_){return t(g,_)}),pt&&ea(g,A),w}function m(g,v,x,k){var w=Hc(x);if(typeof w!="function")throw Error(Z(150));if(x=w.call(x),x==null)throw Error(Z(151));for(var S=w=null,O=v,A=v=0,P=null,M=x.next();O!==null&&!M.done;A++,M=x.next()){O.index>A?(P=O,O=null):P=O.sibling;var _=h(g,O,M.value,k);if(_===null){O===null&&(O=P);break}e&&O&&_.alternate===null&&t(g,O),v=o(_,v,A),S===null?w=_:S.sibling=_,S=_,O=P}if(M.done)return n(g,O),pt&&ea(g,A),w;if(O===null){for(;!M.done;A++,M=x.next())M=f(g,M.value,k),M!==null&&(v=o(M,v,A),S===null?w=M:S.sibling=M,S=M);return pt&&ea(g,A),w}for(O=r(g,O);!M.done;A++,M=x.next())M=d(O,g,A,M.value,k),M!==null&&(e&&M.alternate!==null&&O.delete(M.key===null?A:M.key),v=o(M,v,A),S===null?w=M:S.sibling=M,S=M);return e&&O.forEach(function(E){return t(g,E)}),pt&&ea(g,A),w}function y(g,v,x,k){if(typeof x=="object"&&x!==null&&x.type===Dl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case hp:e:{for(var w=x.key,S=v;S!==null;){if(S.key===w){if(w=x.type,w===Dl){if(S.tag===7){n(g,S.sibling),v=i(S,x.props.children),v.return=g,g=v;break e}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ho&&NE(w)===S.type){n(g,S.sibling),v=i(S,x.props),v.ref=Qc(g,S,x),v.return=g,g=v;break e}n(g,S);break}else t(g,S);S=S.sibling}x.type===Dl?(v=Aa(x.props.children,g.mode,k,x.key),v.return=g,g=v):(k=Nm(x.type,x.key,x.props,null,g.mode,k),k.ref=Qc(g,v,x),k.return=g,g=k)}return s(g);case Nl:e:{for(S=x.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(g,v.sibling),v=i(v,x.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=Rb(x,g.mode,k),v.return=g,g=v}return s(g);case Ho:return S=x._init,y(g,v,S(x._payload),k)}if(Af(x))return p(g,v,x,k);if(Hc(x))return m(g,v,x,k);kp(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,x),v.return=g,g=v):(n(g,v),v=jb(x,g.mode,k),v.return=g,g=v),s(g)):n(g,v)}return y}var Eu=PL(!0),EL=PL(!1),dg=Ds(null),pg=null,Hl=null,XO=null;function YO(){XO=Hl=pg=null}function ZO(e){var t=dg.current;ft(dg),e._currentValue=t}function ew(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function lu(e,t){pg=e,XO=Hl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Un=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(XO!==e)if(e={context:e,memoizedValue:t,next:null},Hl===null){if(pg===null)throw Error(Z(308));Hl=e,pg.dependencies={lanes:0,firstContext:e}}else Hl=Hl.next=e;return t}var ha=null;function JO(e){ha===null?ha=[e]:ha.push(e)}function TL(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,JO(t)):(n.next=i.next,i.next=n),t.interleaved=n,Oo(e,r)}function Oo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Vo=!1;function eC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _L(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function po(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ie&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Oo(e,n)}return i=r.interleaved,i===null?(t.next=t,JO(r)):(t.next=i.next,i.next=t),r.interleaved=t,Oo(e,n)}function Tm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,BO(e,n)}}function DE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function mg(e,t,n,r){var i=e.updateQueue;Vo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var h=a.lane,d=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(h=t,d=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(d,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,h=typeof p=="function"?p.call(d,f,h):p,h==null)break e;f=bt({},f,h);break e;case 2:Vo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else d={eventTime:d,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ba|=s,e.lanes=s,e.memoizedState=f}}function LE(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Z(191,i));i.call(r)}}}var Ud={},Bi=Ds(Ud),wh=Ds(Ud),Sh=Ds(Ud);function da(e){if(e===Ud)throw Error(Z(174));return e}function tC(e,t){switch(rt(Sh,t),rt(wh,e),rt(Bi,Ud),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:R1(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=R1(t,e)}ft(Bi),rt(Bi,t)}function Tu(){ft(Bi),ft(wh),ft(Sh)}function ML(e){da(Sh.current);var t=da(Bi.current),n=R1(t,e.type);t!==n&&(rt(wh,e),rt(Bi,n))}function nC(e){wh.current===e&&(ft(Bi),ft(wh))}var yt=Ds(0);function gg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pb=[];function rC(){for(var e=0;e<Pb.length;e++)Pb[e]._workInProgressVersionPrimary=null;Pb.length=0}var _m=Ro.ReactCurrentDispatcher,Eb=Ro.ReactCurrentBatchConfig,$a=0,vt=null,$t=null,Gt=null,yg=!1,Ff=!1,kh=0,SH=0;function dn(){throw Error(Z(321))}function iC(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!di(e[n],t[n]))return!1;return!0}function oC(e,t,n,r,i,o){if($a=o,vt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_m.current=e===null||e.memoizedState===null?AH:PH,e=n(r,i),Ff){o=0;do{if(Ff=!1,kh=0,25<=o)throw Error(Z(301));o+=1,Gt=$t=null,t.updateQueue=null,_m.current=EH,e=n(r,i)}while(Ff)}if(_m.current=vg,t=$t!==null&&$t.next!==null,$a=0,Gt=$t=vt=null,yg=!1,t)throw Error(Z(300));return e}function sC(){var e=kh!==0;return kh=0,e}function Ci(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?vt.memoizedState=Gt=e:Gt=Gt.next=e,Gt}function qr(){if($t===null){var e=vt.alternate;e=e!==null?e.memoizedState:null}else e=$t.next;var t=Gt===null?vt.memoizedState:Gt.next;if(t!==null)Gt=t,$t=e;else{if(e===null)throw Error(Z(310));$t=e,e={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Gt===null?vt.memoizedState=Gt=e:Gt=Gt.next=e}return Gt}function Oh(e,t){return typeof t=="function"?t(e):t}function Tb(e){var t=qr(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=$t,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,u=o;do{var c=u.lane;if(($a&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,vt.lanes|=c,Ba|=c}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,di(r,t.memoizedState)||(Un=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,vt.lanes|=o,Ba|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function _b(e){var t=qr(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);di(o,t.memoizedState)||(Un=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function IL(){}function jL(e,t){var n=vt,r=qr(),i=t(),o=!di(r.memoizedState,i);if(o&&(r.memoizedState=i,Un=!0),r=r.queue,aC(DL.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Gt!==null&&Gt.memoizedState.tag&1){if(n.flags|=2048,Ch(9,NL.bind(null,n,r,i,t),void 0,null),Zt===null)throw Error(Z(349));$a&30||RL(n,t,i)}return i}function RL(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=vt.updateQueue,t===null?(t={lastEffect:null,stores:null},vt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function NL(e,t,n,r){t.value=n,t.getSnapshot=r,LL(t)&&$L(e)}function DL(e,t,n){return n(function(){LL(t)&&$L(e)})}function LL(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!di(e,n)}catch{return!0}}function $L(e){var t=Oo(e,1);t!==null&&hi(t,e,1,-1)}function $E(e){var t=Ci();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oh,lastRenderedState:e},t.queue=e,e=e.dispatch=CH.bind(null,vt,e),[t.memoizedState,e]}function Ch(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=vt.updateQueue,t===null?(t={lastEffect:null,stores:null},vt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function BL(){return qr().memoizedState}function Mm(e,t,n,r){var i=Ci();vt.flags|=e,i.memoizedState=Ch(1|t,n,void 0,r===void 0?null:r)}function Pv(e,t,n,r){var i=qr();r=r===void 0?null:r;var o=void 0;if($t!==null){var s=$t.memoizedState;if(o=s.destroy,r!==null&&iC(r,s.deps)){i.memoizedState=Ch(t,n,o,r);return}}vt.flags|=e,i.memoizedState=Ch(1|t,n,o,r)}function BE(e,t){return Mm(8390656,8,e,t)}function aC(e,t){return Pv(2048,8,e,t)}function FL(e,t){return Pv(4,2,e,t)}function zL(e,t){return Pv(4,4,e,t)}function WL(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function UL(e,t,n){return n=n!=null?n.concat([e]):null,Pv(4,4,WL.bind(null,t,e),n)}function lC(){}function HL(e,t){var n=qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&iC(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function VL(e,t){var n=qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&iC(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function qL(e,t,n){return $a&21?(di(n,t)||(n=YD(),vt.lanes|=n,Ba|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Un=!0),e.memoizedState=n)}function kH(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var r=Eb.transition;Eb.transition={};try{e(!1),t()}finally{ze=n,Eb.transition=r}}function KL(){return qr().memoizedState}function OH(e,t,n){var r=ps(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},GL(e))QL(t,n);else if(n=TL(e,t,n,r),n!==null){var i=Rn();hi(n,e,r,i),XL(n,t,r)}}function CH(e,t,n){var r=ps(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(GL(e))QL(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,di(a,s)){var l=t.interleaved;l===null?(i.next=i,JO(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=TL(e,t,i,r),n!==null&&(i=Rn(),hi(n,e,r,i),XL(n,t,r))}}function GL(e){var t=e.alternate;return e===vt||t!==null&&t===vt}function QL(e,t){Ff=yg=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function XL(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,BO(e,n)}}var vg={readContext:Vr,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useInsertionEffect:dn,useLayoutEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useMutableSource:dn,useSyncExternalStore:dn,useId:dn,unstable_isNewReconciler:!1},AH={readContext:Vr,useCallback:function(e,t){return Ci().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:BE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Mm(4194308,4,WL.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Mm(4,2,e,t)},useMemo:function(e,t){var n=Ci();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ci();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=OH.bind(null,vt,e),[r.memoizedState,e]},useRef:function(e){var t=Ci();return e={current:e},t.memoizedState=e},useState:$E,useDebugValue:lC,useDeferredValue:function(e){return Ci().memoizedState=e},useTransition:function(){var e=$E(!1),t=e[0];return e=kH.bind(null,e[1]),Ci().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=vt,i=Ci();if(pt){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),Zt===null)throw Error(Z(349));$a&30||RL(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,BE(DL.bind(null,r,o,e),[e]),r.flags|=2048,Ch(9,NL.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ci(),t=Zt.identifierPrefix;if(pt){var n=co,r=uo;n=(r&~(1<<32-fi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=kh++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=SH++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},PH={readContext:Vr,useCallback:HL,useContext:Vr,useEffect:aC,useImperativeHandle:UL,useInsertionEffect:FL,useLayoutEffect:zL,useMemo:VL,useReducer:Tb,useRef:BL,useState:function(){return Tb(Oh)},useDebugValue:lC,useDeferredValue:function(e){var t=qr();return qL(t,$t.memoizedState,e)},useTransition:function(){var e=Tb(Oh)[0],t=qr().memoizedState;return[e,t]},useMutableSource:IL,useSyncExternalStore:jL,useId:KL,unstable_isNewReconciler:!1},EH={readContext:Vr,useCallback:HL,useContext:Vr,useEffect:aC,useImperativeHandle:UL,useInsertionEffect:FL,useLayoutEffect:zL,useMemo:VL,useReducer:_b,useRef:BL,useState:function(){return _b(Oh)},useDebugValue:lC,useDeferredValue:function(e){var t=qr();return $t===null?t.memoizedState=e:qL(t,$t.memoizedState,e)},useTransition:function(){var e=_b(Oh)[0],t=qr().memoizedState;return[e,t]},useMutableSource:IL,useSyncExternalStore:jL,useId:KL,unstable_isNewReconciler:!1};function ti(e,t){if(e&&e.defaultProps){t=bt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function tw(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:bt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ev={isMounted:function(e){return(e=e._reactInternals)?tl(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Rn(),i=ps(e),o=po(r,i);o.payload=t,n!=null&&(o.callback=n),t=hs(e,o,i),t!==null&&(hi(t,e,i,r),Tm(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Rn(),i=ps(e),o=po(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=hs(e,o,i),t!==null&&(hi(t,e,i,r),Tm(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rn(),r=ps(e),i=po(n,r);i.tag=2,t!=null&&(i.callback=t),t=hs(e,i,r),t!==null&&(hi(t,e,r,n),Tm(t,e,r))}};function FE(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!yh(n,r)||!yh(i,o):!0}function YL(e,t,n){var r=!1,i=Os,o=t.contextType;return typeof o=="object"&&o!==null?o=Vr(o):(i=Xn(t)?Da:bn.current,r=t.contextTypes,o=(r=r!=null)?Au(e,i):Os),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ev,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function zE(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ev.enqueueReplaceState(t,t.state,null)}function nw(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},eC(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Vr(o):(o=Xn(t)?Da:bn.current,i.context=Au(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(tw(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Ev.enqueueReplaceState(i,i.state,null),mg(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function _u(e,t){try{var n="",r=t;do n+=nU(r),r=r.return;while(r);var i=n}catch(o){i=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:i,digest:null}}function Mb(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function rw(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var TH=typeof WeakMap=="function"?WeakMap:Map;function ZL(e,t,n){n=po(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xg||(xg=!0,dw=r),rw(e,t)},n}function JL(e,t,n){n=po(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){rw(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){rw(e,t),typeof r!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function WE(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new TH;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=UH.bind(null,e,t,n),t.then(e,e))}function UE(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function HE(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=po(-1,1),t.tag=2,hs(n,t,1))),n.lanes|=1),e)}var _H=Ro.ReactCurrentOwner,Un=!1;function An(e,t,n,r){t.child=e===null?EL(t,null,n,r):Eu(t,e.child,n,r)}function VE(e,t,n,r,i){n=n.render;var o=t.ref;return lu(t,i),r=oC(e,t,n,r,o,i),n=sC(),e!==null&&!Un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Co(e,t,i)):(pt&&n&&KO(t),t.flags|=1,An(e,t,r,i),t.child)}function qE(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!gC(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,e$(e,t,o,r,i)):(e=Nm(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:yh,n(s,r)&&e.ref===t.ref)return Co(e,t,i)}return t.flags|=1,e=ms(o,r),e.ref=t.ref,e.return=t,t.child=e}function e$(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(yh(o,r)&&e.ref===t.ref)if(Un=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Un=!0);else return t.lanes=e.lanes,Co(e,t,i)}return iw(e,t,n,r,i)}function t$(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(ql,hr),hr|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,rt(ql,hr),hr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,rt(ql,hr),hr|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,rt(ql,hr),hr|=r;return An(e,t,i,n),t.child}function n$(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function iw(e,t,n,r,i){var o=Xn(n)?Da:bn.current;return o=Au(t,o),lu(t,i),n=oC(e,t,n,r,o,i),r=sC(),e!==null&&!Un?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Co(e,t,i)):(pt&&r&&KO(t),t.flags|=1,An(e,t,n,i),t.child)}function KE(e,t,n,r,i){if(Xn(n)){var o=!0;cg(t)}else o=!1;if(lu(t,i),t.stateNode===null)Im(e,t),YL(t,n,r),nw(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Vr(u):(u=Xn(n)?Da:bn.current,u=Au(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&zE(t,s,r,u),Vo=!1;var h=t.memoizedState;s.state=h,mg(t,r,s,i),l=t.memoizedState,a!==r||h!==l||Qn.current||Vo?(typeof c=="function"&&(tw(t,n,c,r),l=t.memoizedState),(a=Vo||FE(t,n,a,r,h,l,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,_L(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ti(t.type,a),s.props=u,f=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Vr(l):(l=Xn(n)?Da:bn.current,l=Au(t,l));var d=n.getDerivedStateFromProps;(c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&zE(t,s,r,l),Vo=!1,h=t.memoizedState,s.state=h,mg(t,r,s,i);var p=t.memoizedState;a!==f||h!==p||Qn.current||Vo?(typeof d=="function"&&(tw(t,n,d,r),p=t.memoizedState),(u=Vo||FE(t,n,u,r,h,p,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ow(e,t,n,r,o,i)}function ow(e,t,n,r,i,o){n$(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&IE(t,n,!1),Co(e,t,o);r=t.stateNode,_H.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Eu(t,e.child,null,o),t.child=Eu(t,null,a,o)):An(e,t,a,o),t.memoizedState=r.state,i&&IE(t,n,!0),t.child}function r$(e){var t=e.stateNode;t.pendingContext?ME(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ME(e,t.context,!1),tC(e,t.containerInfo)}function GE(e,t,n,r,i){return Pu(),QO(i),t.flags|=256,An(e,t,n,r),t.child}var sw={dehydrated:null,treeContext:null,retryLane:0};function aw(e){return{baseLanes:e,cachePool:null,transitions:null}}function i$(e,t,n){var r=t.pendingProps,i=yt.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),rt(yt,i&1),e===null)return J1(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Mv(s,r,0,null),e=Aa(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=aw(n),t.memoizedState=sw,e):uC(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return MH(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ms(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=ms(a,o):(o=Aa(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?aw(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=sw,r}return o=e.child,e=o.sibling,r=ms(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function uC(e,t){return t=Mv({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Op(e,t,n,r){return r!==null&&QO(r),Eu(t,e.child,null,n),e=uC(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function MH(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Mb(Error(Z(422))),Op(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Mv({mode:"visible",children:r.children},i,0,null),o=Aa(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Eu(t,e.child,null,s),t.child.memoizedState=aw(s),t.memoizedState=sw,o);if(!(t.mode&1))return Op(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(Z(419)),r=Mb(o,r,void 0),Op(e,t,s,r)}if(a=(s&e.childLanes)!==0,Un||a){if(r=Zt,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Oo(e,i),hi(r,e,i,-1))}return mC(),r=Mb(Error(Z(421))),Op(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=HH.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,vr=fs(i.nextSibling),wr=t,pt=!0,si=null,e!==null&&(Ir[jr++]=uo,Ir[jr++]=co,Ir[jr++]=La,uo=e.id,co=e.overflow,La=t),t=uC(t,r.children),t.flags|=4096,t)}function QE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ew(e.return,t,n)}function Ib(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function o$(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(An(e,t,r.children,n),r=yt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&QE(e,n,t);else if(e.tag===19)QE(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(rt(yt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&gg(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ib(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&gg(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ib(t,!0,n,null,o);break;case"together":Ib(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Im(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Co(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ba|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=ms(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ms(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function IH(e,t,n){switch(t.tag){case 3:r$(t),Pu();break;case 5:ML(t);break;case 1:Xn(t.type)&&cg(t);break;case 4:tC(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;rt(dg,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(rt(yt,yt.current&1),t.flags|=128,null):n&t.child.childLanes?i$(e,t,n):(rt(yt,yt.current&1),e=Co(e,t,n),e!==null?e.sibling:null);rt(yt,yt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return o$(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),rt(yt,yt.current),r)break;return null;case 22:case 23:return t.lanes=0,t$(e,t,n)}return Co(e,t,n)}var s$,lw,a$,l$;s$=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};lw=function(){};a$=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,da(Bi.current);var o=null;switch(n){case"input":i=_1(e,i),r=_1(e,r),o=[];break;case"select":i=bt({},i,{value:void 0}),r=bt({},r,{value:void 0}),o=[];break;case"textarea":i=j1(e,i),r=j1(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=lg)}N1(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ch.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i?.[u],r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ch.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&at("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};l$=function(e,t,n,r){n!==r&&(t.flags|=4)};function Xc(e,t){if(!pt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function jH(e,t,n){var r=t.pendingProps;switch(GO(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(t),null;case 1:return Xn(t.type)&&ug(),pn(t),null;case 3:return r=t.stateNode,Tu(),ft(Qn),ft(bn),rC(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Sp(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,si!==null&&(gw(si),si=null))),lw(e,t),pn(t),null;case 5:nC(t);var i=da(Sh.current);if(n=t.type,e!==null&&t.stateNode!=null)a$(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Z(166));return pn(t),null}if(e=da(Bi.current),Sp(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Ei]=t,r[xh]=o,e=(t.mode&1)!==0,n){case"dialog":at("cancel",r),at("close",r);break;case"iframe":case"object":case"embed":at("load",r);break;case"video":case"audio":for(i=0;i<Ef.length;i++)at(Ef[i],r);break;case"source":at("error",r);break;case"img":case"image":case"link":at("error",r),at("load",r);break;case"details":at("toggle",r);break;case"input":iE(r,o),at("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},at("invalid",r);break;case"textarea":sE(r,o),at("invalid",r)}N1(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&wp(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&wp(r.textContent,a,e),i=["children",""+a]):ch.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&at("scroll",r)}switch(n){case"input":dp(r),oE(r,o,!0);break;case"textarea":dp(r),aE(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=lg)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=DD(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ei]=t,e[xh]=r,s$(e,t,!1,!1),t.stateNode=e;e:{switch(s=D1(n,r),n){case"dialog":at("cancel",e),at("close",e),i=r;break;case"iframe":case"object":case"embed":at("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ef.length;i++)at(Ef[i],e);i=r;break;case"source":at("error",e),i=r;break;case"img":case"image":case"link":at("error",e),at("load",e),i=r;break;case"details":at("toggle",e),i=r;break;case"input":iE(e,r),i=_1(e,r),at("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=bt({},r,{value:void 0}),at("invalid",e);break;case"textarea":sE(e,r),i=j1(e,r),at("invalid",e);break;default:i=r}N1(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?BD(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&LD(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&fh(e,l):typeof l=="number"&&fh(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ch.hasOwnProperty(o)?l!=null&&o==="onScroll"&&at("scroll",e):l!=null&&jO(e,o,l,s))}switch(n){case"input":dp(e),oE(e,r,!1);break;case"textarea":dp(e),aE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ks(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?iu(e,!!r.multiple,o,!1):r.defaultValue!=null&&iu(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=lg)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pn(t),null;case 6:if(e&&t.stateNode!=null)l$(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Z(166));if(n=da(Sh.current),da(Bi.current),Sp(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ei]=t,(o=r.nodeValue!==n)&&(e=wr,e!==null))switch(e.tag){case 3:wp(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wp(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ei]=t,t.stateNode=r}return pn(t),null;case 13:if(ft(yt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pt&&vr!==null&&t.mode&1&&!(t.flags&128))AL(),Pu(),t.flags|=98560,o=!1;else if(o=Sp(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(Z(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Z(317));o[Ei]=t}else Pu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pn(t),o=!1}else si!==null&&(gw(si),si=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||yt.current&1?Ut===0&&(Ut=3):mC())),t.updateQueue!==null&&(t.flags|=4),pn(t),null);case 4:return Tu(),lw(e,t),e===null&&vh(t.stateNode.containerInfo),pn(t),null;case 10:return ZO(t.type._context),pn(t),null;case 17:return Xn(t.type)&&ug(),pn(t),null;case 19:if(ft(yt),o=t.memoizedState,o===null)return pn(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Xc(o,!1);else{if(Ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=gg(e),s!==null){for(t.flags|=128,Xc(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return rt(yt,yt.current&1|2),t.child}e=e.sibling}o.tail!==null&&Pt()>Mu&&(t.flags|=128,r=!0,Xc(o,!1),t.lanes=4194304)}else{if(!r)if(e=gg(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!pt)return pn(t),null}else 2*Pt()-o.renderingStartTime>Mu&&n!==1073741824&&(t.flags|=128,r=!0,Xc(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Pt(),t.sibling=null,n=yt.current,rt(yt,r?n&1|2:n&1),t):(pn(t),null);case 22:case 23:return pC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?hr&1073741824&&(pn(t),t.subtreeFlags&6&&(t.flags|=8192)):pn(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function RH(e,t){switch(GO(t),t.tag){case 1:return Xn(t.type)&&ug(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tu(),ft(Qn),ft(bn),rC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return nC(t),null;case 13:if(ft(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Pu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(yt),null;case 4:return Tu(),null;case 10:return ZO(t.type._context),null;case 22:case 23:return pC(),null;case 24:return null;default:return null}}var Cp=!1,yn=!1,NH=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Vl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xt(e,t,r)}else n.current=null}function uw(e,t,n){try{n()}catch(r){xt(e,t,r)}}var XE=!1;function DH(e,t){if(q1=og,e=dL(),qO(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var d;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===e)break t;if(h===n&&++u===i&&(a=s),h===o&&++c===r&&(l=s),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(K1={focusedElem:e,selectionRange:n},og=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,y=p.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:ti(t.type,m),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Z(163))}}catch(k){xt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return p=XE,XE=!1,p}function zf(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&uw(t,n,o)}i=i.next}while(i!==r)}}function Tv(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cw(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function u$(e){var t=e.alternate;t!==null&&(e.alternate=null,u$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ei],delete t[xh],delete t[X1],delete t[vH],delete t[bH])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function c$(e){return e.tag===5||e.tag===3||e.tag===4}function YE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||c$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=lg));else if(r!==4&&(e=e.child,e!==null))for(fw(e,t,n),e=e.sibling;e!==null;)fw(e,t,n),e=e.sibling}function hw(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hw(e,t,n),e=e.sibling;e!==null;)hw(e,t,n),e=e.sibling}var on=null,ni=!1;function zo(e,t,n){for(n=n.child;n!==null;)f$(e,t,n),n=n.sibling}function f$(e,t,n){if($i&&typeof $i.onCommitFiberUnmount=="function")try{$i.onCommitFiberUnmount(wv,n)}catch{}switch(n.tag){case 5:yn||Vl(n,t);case 6:var r=on,i=ni;on=null,zo(e,t,n),on=r,ni=i,on!==null&&(ni?(e=on,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):on.removeChild(n.stateNode));break;case 18:on!==null&&(ni?(e=on,n=n.stateNode,e.nodeType===8?Cb(e.parentNode,n):e.nodeType===1&&Cb(e,n),mh(e)):Cb(on,n.stateNode));break;case 4:r=on,i=ni,on=n.stateNode.containerInfo,ni=!0,zo(e,t,n),on=r,ni=i;break;case 0:case 11:case 14:case 15:if(!yn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&uw(n,t,s),i=i.next}while(i!==r)}zo(e,t,n);break;case 1:if(!yn&&(Vl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xt(n,t,a)}zo(e,t,n);break;case 21:zo(e,t,n);break;case 22:n.mode&1?(yn=(r=yn)||n.memoizedState!==null,zo(e,t,n),yn=r):zo(e,t,n);break;default:zo(e,t,n)}}function ZE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new NH),t.forEach(function(r){var i=VH.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Jr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:on=a.stateNode,ni=!1;break e;case 3:on=a.stateNode.containerInfo,ni=!0;break e;case 4:on=a.stateNode.containerInfo,ni=!0;break e}a=a.return}if(on===null)throw Error(Z(160));f$(o,s,i),on=null,ni=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){xt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)h$(t,e),t=t.sibling}function h$(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jr(t,e),xi(e),r&4){try{zf(3,e,e.return),Tv(3,e)}catch(m){xt(e,e.return,m)}try{zf(5,e,e.return)}catch(m){xt(e,e.return,m)}}break;case 1:Jr(t,e),xi(e),r&512&&n!==null&&Vl(n,n.return);break;case 5:if(Jr(t,e),xi(e),r&512&&n!==null&&Vl(n,n.return),e.flags&32){var i=e.stateNode;try{fh(i,"")}catch(m){xt(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&RD(i,o),D1(a,s);var u=D1(a,o);for(s=0;s<l.length;s+=2){var c=l[s],f=l[s+1];c==="style"?BD(i,f):c==="dangerouslySetInnerHTML"?LD(i,f):c==="children"?fh(i,f):jO(i,c,f,u)}switch(a){case"input":M1(i,o);break;case"textarea":ND(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var d=o.value;d!=null?iu(i,!!o.multiple,d,!1):h!==!!o.multiple&&(o.defaultValue!=null?iu(i,!!o.multiple,o.defaultValue,!0):iu(i,!!o.multiple,o.multiple?[]:"",!1))}i[xh]=o}catch(m){xt(e,e.return,m)}}break;case 6:if(Jr(t,e),xi(e),r&4){if(e.stateNode===null)throw Error(Z(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){xt(e,e.return,m)}}break;case 3:if(Jr(t,e),xi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{mh(t.containerInfo)}catch(m){xt(e,e.return,m)}break;case 4:Jr(t,e),xi(e);break;case 13:Jr(t,e),xi(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(hC=Pt())),r&4&&ZE(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(yn=(u=yn)||c,Jr(t,e),yn=u):Jr(t,e),xi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(ae=e,c=e.child;c!==null;){for(f=ae=c;ae!==null;){switch(h=ae,d=h.child,h.tag){case 0:case 11:case 14:case 15:zf(4,h,h.return);break;case 1:Vl(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){xt(r,n,m)}}break;case 5:Vl(h,h.return);break;case 22:if(h.memoizedState!==null){eT(f);continue}}d!==null?(d.return=h,ae=d):eT(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=$D("display",s))}catch(m){xt(e,e.return,m)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){xt(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Jr(t,e),xi(e),r&4&&ZE(e);break;case 21:break;default:Jr(t,e),xi(e)}}function xi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(c$(n)){var r=n;break e}n=n.return}throw Error(Z(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(fh(i,""),r.flags&=-33);var o=YE(e);hw(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=YE(e);fw(e,a,s);break;default:throw Error(Z(161))}}catch(l){xt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function LH(e,t,n){ae=e,d$(e)}function d$(e,t,n){for(var r=(e.mode&1)!==0;ae!==null;){var i=ae,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Cp;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||yn;a=Cp;var u=yn;if(Cp=s,(yn=l)&&!u)for(ae=i;ae!==null;)s=ae,l=s.child,s.tag===22&&s.memoizedState!==null?tT(i):l!==null?(l.return=s,ae=l):tT(i);for(;o!==null;)ae=o,d$(o),o=o.sibling;ae=i,Cp=a,yn=u}JE(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ae=o):JE(e)}}function JE(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yn||Tv(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ti(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&LE(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}LE(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&mh(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Z(163))}yn||t.flags&512&&cw(t)}catch(h){xt(t,t.return,h)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function eT(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ae=n;break}ae=t.return}}function tT(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Tv(4,t)}catch(l){xt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){xt(t,i,l)}}var o=t.return;try{cw(t)}catch(l){xt(t,o,l)}break;case 5:var s=t.return;try{cw(t)}catch(l){xt(t,s,l)}}}catch(l){xt(t,t.return,l)}if(t===e){ae=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ae=a;break}ae=t.return}}var $H=Math.ceil,bg=Ro.ReactCurrentDispatcher,cC=Ro.ReactCurrentOwner,Ur=Ro.ReactCurrentBatchConfig,Ie=0,Zt=null,jt=null,un=0,hr=0,ql=Ds(0),Ut=0,Ah=null,Ba=0,_v=0,fC=0,Wf=null,Bn=null,hC=0,Mu=1/0,ro=null,xg=!1,dw=null,ds=null,Ap=!1,ts=null,wg=0,Uf=0,pw=null,jm=-1,Rm=0;function Rn(){return Ie&6?Pt():jm!==-1?jm:jm=Pt()}function ps(e){return e.mode&1?Ie&2&&un!==0?un&-un:wH.transition!==null?(Rm===0&&(Rm=YD()),Rm):(e=ze,e!==0||(e=window.event,e=e===void 0?16:iL(e.type)),e):1}function hi(e,t,n,r){if(50<Uf)throw Uf=0,pw=null,Error(Z(185));Fd(e,n,r),(!(Ie&2)||e!==Zt)&&(e===Zt&&(!(Ie&2)&&(_v|=n),Ut===4&&Yo(e,un)),Yn(e,r),n===1&&Ie===0&&!(t.mode&1)&&(Mu=Pt()+500,Av&&Ls()))}function Yn(e,t){var n=e.callbackNode;wU(e,t);var r=ig(e,e===Zt?un:0);if(r===0)n!==null&&cE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&cE(n),t===1)e.tag===0?xH(nT.bind(null,e)):kL(nT.bind(null,e)),gH(function(){!(Ie&6)&&Ls()}),n=null;else{switch(ZD(r)){case 1:n=$O;break;case 4:n=QD;break;case 16:n=rg;break;case 536870912:n=XD;break;default:n=rg}n=w$(n,p$.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function p$(e,t){if(jm=-1,Rm=0,Ie&6)throw Error(Z(327));var n=e.callbackNode;if(uu()&&e.callbackNode!==n)return null;var r=ig(e,e===Zt?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Sg(e,r);else{t=r;var i=Ie;Ie|=2;var o=g$();(Zt!==e||un!==t)&&(ro=null,Mu=Pt()+500,Ca(e,t));do try{zH();break}catch(a){m$(e,a)}while(!0);YO(),bg.current=o,Ie=i,jt!==null?t=0:(Zt=null,un=0,t=Ut)}if(t!==0){if(t===2&&(i=z1(e),i!==0&&(r=i,t=mw(e,i))),t===1)throw n=Ah,Ca(e,0),Yo(e,r),Yn(e,Pt()),n;if(t===6)Yo(e,r);else{if(i=e.current.alternate,!(r&30)&&!BH(i)&&(t=Sg(e,r),t===2&&(o=z1(e),o!==0&&(r=o,t=mw(e,o))),t===1))throw n=Ah,Ca(e,0),Yo(e,r),Yn(e,Pt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Z(345));case 2:ta(e,Bn,ro);break;case 3:if(Yo(e,r),(r&130023424)===r&&(t=hC+500-Pt(),10<t)){if(ig(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Rn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Q1(ta.bind(null,e,Bn,ro),t);break}ta(e,Bn,ro);break;case 4:if(Yo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-fi(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=Pt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$H(r/1960))-r,10<r){e.timeoutHandle=Q1(ta.bind(null,e,Bn,ro),r);break}ta(e,Bn,ro);break;case 5:ta(e,Bn,ro);break;default:throw Error(Z(329))}}}return Yn(e,Pt()),e.callbackNode===n?p$.bind(null,e):null}function mw(e,t){var n=Wf;return e.current.memoizedState.isDehydrated&&(Ca(e,t).flags|=256),e=Sg(e,t),e!==2&&(t=Bn,Bn=n,t!==null&&gw(t)),e}function gw(e){Bn===null?Bn=e:Bn.push.apply(Bn,e)}function BH(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!di(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Yo(e,t){for(t&=~fC,t&=~_v,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-fi(t),r=1<<n;e[n]=-1,t&=~r}}function nT(e){if(Ie&6)throw Error(Z(327));uu();var t=ig(e,0);if(!(t&1))return Yn(e,Pt()),null;var n=Sg(e,t);if(e.tag!==0&&n===2){var r=z1(e);r!==0&&(t=r,n=mw(e,r))}if(n===1)throw n=Ah,Ca(e,0),Yo(e,t),Yn(e,Pt()),n;if(n===6)throw Error(Z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ta(e,Bn,ro),Yn(e,Pt()),null}function dC(e,t){var n=Ie;Ie|=1;try{return e(t)}finally{Ie=n,Ie===0&&(Mu=Pt()+500,Av&&Ls())}}function Fa(e){ts!==null&&ts.tag===0&&!(Ie&6)&&uu();var t=Ie;Ie|=1;var n=Ur.transition,r=ze;try{if(Ur.transition=null,ze=1,e)return e()}finally{ze=r,Ur.transition=n,Ie=t,!(Ie&6)&&Ls()}}function pC(){hr=ql.current,ft(ql)}function Ca(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,mH(n)),jt!==null)for(n=jt.return;n!==null;){var r=n;switch(GO(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ug();break;case 3:Tu(),ft(Qn),ft(bn),rC();break;case 5:nC(r);break;case 4:Tu();break;case 13:ft(yt);break;case 19:ft(yt);break;case 10:ZO(r.type._context);break;case 22:case 23:pC()}n=n.return}if(Zt=e,jt=e=ms(e.current,null),un=hr=t,Ut=0,Ah=null,fC=_v=Ba=0,Bn=Wf=null,ha!==null){for(t=0;t<ha.length;t++)if(n=ha[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}ha=null}return e}function m$(e,t){do{var n=jt;try{if(YO(),_m.current=vg,yg){for(var r=vt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}yg=!1}if($a=0,Gt=$t=vt=null,Ff=!1,kh=0,cC.current=null,n===null||n.return===null){Ut=1,Ah=t,jt=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=un,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var d=UE(s);if(d!==null){d.flags&=-257,HE(d,s,a,o,t),d.mode&1&&WE(o,u,t),t=d,l=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){WE(o,u,t),mC();break e}l=Error(Z(426))}}else if(pt&&a.mode&1){var y=UE(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),HE(y,s,a,o,t),QO(_u(l,a));break e}}o=l=_u(l,a),Ut!==4&&(Ut=2),Wf===null?Wf=[o]:Wf.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=ZL(o,l,t);DE(o,g);break e;case 1:a=l;var v=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ds===null||!ds.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var k=JL(o,a,t);DE(o,k);break e}}o=o.return}while(o!==null)}v$(n)}catch(w){t=w,jt===n&&n!==null&&(jt=n=n.return);continue}break}while(!0)}function g$(){var e=bg.current;return bg.current=vg,e===null?vg:e}function mC(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Zt===null||!(Ba&268435455)&&!(_v&268435455)||Yo(Zt,un)}function Sg(e,t){var n=Ie;Ie|=2;var r=g$();(Zt!==e||un!==t)&&(ro=null,Ca(e,t));do try{FH();break}catch(i){m$(e,i)}while(!0);if(YO(),Ie=n,bg.current=r,jt!==null)throw Error(Z(261));return Zt=null,un=0,Ut}function FH(){for(;jt!==null;)y$(jt)}function zH(){for(;jt!==null&&!hU();)y$(jt)}function y$(e){var t=x$(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?v$(e):jt=t,cC.current=null}function v$(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=RH(n,t),n!==null){n.flags&=32767,jt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ut=6,jt=null;return}}else if(n=jH(n,t,hr),n!==null){jt=n;return}if(t=t.sibling,t!==null){jt=t;return}jt=t=e}while(t!==null);Ut===0&&(Ut=5)}function ta(e,t,n){var r=ze,i=Ur.transition;try{Ur.transition=null,ze=1,WH(e,t,n,r)}finally{Ur.transition=i,ze=r}return null}function WH(e,t,n,r){do uu();while(ts!==null);if(Ie&6)throw Error(Z(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Z(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(SU(e,o),e===Zt&&(jt=Zt=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ap||(Ap=!0,w$(rg,function(){return uu(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Ur.transition,Ur.transition=null;var s=ze;ze=1;var a=Ie;Ie|=4,cC.current=null,DH(e,n),h$(n,e),lH(K1),og=!!q1,K1=q1=null,e.current=n,LH(n),dU(),Ie=a,ze=s,Ur.transition=o}else e.current=n;if(Ap&&(Ap=!1,ts=e,wg=i),o=e.pendingLanes,o===0&&(ds=null),gU(n.stateNode),Yn(e,Pt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(xg)throw xg=!1,e=dw,dw=null,e;return wg&1&&e.tag!==0&&uu(),o=e.pendingLanes,o&1?e===pw?Uf++:(Uf=0,pw=e):Uf=0,Ls(),null}function uu(){if(ts!==null){var e=ZD(wg),t=Ur.transition,n=ze;try{if(Ur.transition=null,ze=16>e?16:e,ts===null)var r=!1;else{if(e=ts,ts=null,wg=0,Ie&6)throw Error(Z(331));var i=Ie;for(Ie|=4,ae=e.current;ae!==null;){var o=ae,s=o.child;if(ae.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ae=u;ae!==null;){var c=ae;switch(c.tag){case 0:case 11:case 15:zf(8,c,o)}var f=c.child;if(f!==null)f.return=c,ae=f;else for(;ae!==null;){c=ae;var h=c.sibling,d=c.return;if(u$(c),c===u){ae=null;break}if(h!==null){h.return=d,ae=h;break}ae=d}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}ae=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,ae=s;else e:for(;ae!==null;){if(o=ae,o.flags&2048)switch(o.tag){case 0:case 11:case 15:zf(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,ae=g;break e}ae=o.return}}var v=e.current;for(ae=v;ae!==null;){s=ae;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,ae=x;else e:for(s=v;ae!==null;){if(a=ae,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Tv(9,a)}}catch(w){xt(a,a.return,w)}if(a===s){ae=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,ae=k;break e}ae=a.return}}if(Ie=i,Ls(),$i&&typeof $i.onPostCommitFiberRoot=="function")try{$i.onPostCommitFiberRoot(wv,e)}catch{}r=!0}return r}finally{ze=n,Ur.transition=t}}return!1}function rT(e,t,n){t=_u(n,t),t=ZL(e,t,1),e=hs(e,t,1),t=Rn(),e!==null&&(Fd(e,1,t),Yn(e,t))}function xt(e,t,n){if(e.tag===3)rT(e,e,n);else for(;t!==null;){if(t.tag===3){rT(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ds===null||!ds.has(r))){e=_u(n,e),e=JL(t,e,1),t=hs(t,e,1),e=Rn(),t!==null&&(Fd(t,1,e),Yn(t,e));break}}t=t.return}}function UH(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Rn(),e.pingedLanes|=e.suspendedLanes&n,Zt===e&&(un&n)===n&&(Ut===4||Ut===3&&(un&130023424)===un&&500>Pt()-hC?Ca(e,0):fC|=n),Yn(e,t)}function b$(e,t){t===0&&(e.mode&1?(t=gp,gp<<=1,!(gp&130023424)&&(gp=4194304)):t=1);var n=Rn();e=Oo(e,t),e!==null&&(Fd(e,t,n),Yn(e,n))}function HH(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),b$(e,n)}function VH(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Z(314))}r!==null&&r.delete(t),b$(e,n)}var x$;x$=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qn.current)Un=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Un=!1,IH(e,t,n);Un=!!(e.flags&131072)}else Un=!1,pt&&t.flags&1048576&&OL(t,hg,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Im(e,t),e=t.pendingProps;var i=Au(t,bn.current);lu(t,n),i=oC(null,t,r,e,i,n);var o=sC();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xn(r)?(o=!0,cg(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,eC(t),i.updater=Ev,t.stateNode=i,i._reactInternals=t,nw(t,r,e,n),t=ow(null,t,r,!0,o,n)):(t.tag=0,pt&&o&&KO(t),An(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Im(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=KH(r),e=ti(r,e),i){case 0:t=iw(null,t,r,e,n);break e;case 1:t=KE(null,t,r,e,n);break e;case 11:t=VE(null,t,r,e,n);break e;case 14:t=qE(null,t,r,ti(r.type,e),n);break e}throw Error(Z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),iw(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),KE(e,t,r,i,n);case 3:e:{if(r$(t),e===null)throw Error(Z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_L(e,t),mg(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=_u(Error(Z(423)),t),t=GE(e,t,r,n,i);break e}else if(r!==i){i=_u(Error(Z(424)),t),t=GE(e,t,r,n,i);break e}else for(vr=fs(t.stateNode.containerInfo.firstChild),wr=t,pt=!0,si=null,n=EL(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pu(),r===i){t=Co(e,t,n);break e}An(e,t,r,n)}t=t.child}return t;case 5:return ML(t),e===null&&J1(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,G1(r,i)?s=null:o!==null&&G1(r,o)&&(t.flags|=32),n$(e,t),An(e,t,s,n),t.child;case 6:return e===null&&J1(t),null;case 13:return i$(e,t,n);case 4:return tC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Eu(t,null,r,n):An(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),VE(e,t,r,i,n);case 7:return An(e,t,t.pendingProps,n),t.child;case 8:return An(e,t,t.pendingProps.children,n),t.child;case 12:return An(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,rt(dg,r._currentValue),r._currentValue=s,o!==null)if(di(o.value,s)){if(o.children===i.children&&!Qn.current){t=Co(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=po(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),ew(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Z(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ew(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}An(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,lu(t,n),i=Vr(i),r=r(i),t.flags|=1,An(e,t,r,n),t.child;case 14:return r=t.type,i=ti(r,t.pendingProps),i=ti(r.type,i),qE(e,t,r,i,n);case 15:return e$(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),Im(e,t),t.tag=1,Xn(r)?(e=!0,cg(t)):e=!1,lu(t,n),YL(t,r,i),nw(t,r,i,n),ow(null,t,r,!0,e,n);case 19:return o$(e,t,n);case 22:return t$(e,t,n)}throw Error(Z(156,t.tag))};function w$(e,t){return GD(e,t)}function qH(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(e,t,n,r){return new qH(e,t,n,r)}function gC(e){return e=e.prototype,!(!e||!e.isReactComponent)}function KH(e){if(typeof e=="function")return gC(e)?1:0;if(e!=null){if(e=e.$$typeof,e===NO)return 11;if(e===DO)return 14}return 2}function ms(e,t){var n=e.alternate;return n===null?(n=Lr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nm(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")gC(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Dl:return Aa(n.children,i,o,t);case RO:s=8,i|=8;break;case A1:return e=Lr(12,n,t,i|2),e.elementType=A1,e.lanes=o,e;case P1:return e=Lr(13,n,t,i),e.elementType=P1,e.lanes=o,e;case E1:return e=Lr(19,n,t,i),e.elementType=E1,e.lanes=o,e;case MD:return Mv(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case TD:s=10;break e;case _D:s=9;break e;case NO:s=11;break e;case DO:s=14;break e;case Ho:s=16,r=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=Lr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Aa(e,t,n,r){return e=Lr(7,e,r,t),e.lanes=n,e}function Mv(e,t,n,r){return e=Lr(22,e,r,t),e.elementType=MD,e.lanes=n,e.stateNode={isHidden:!1},e}function jb(e,t,n){return e=Lr(6,e,null,t),e.lanes=n,e}function Rb(e,t,n){return t=Lr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function GH(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pb(0),this.expirationTimes=pb(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pb(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function yC(e,t,n,r,i,o,s,a,l){return e=new GH(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Lr(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},eC(o),e}function QH(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function S$(e){if(!e)return Os;e=e._reactInternals;e:{if(tl(e)!==e||e.tag!==1)throw Error(Z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Xn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Z(171))}if(e.tag===1){var n=e.type;if(Xn(n))return SL(e,n,t)}return t}function k$(e,t,n,r,i,o,s,a,l){return e=yC(n,r,!0,e,i,o,s,a,l),e.context=S$(null),n=e.current,r=Rn(),i=ps(n),o=po(r,i),o.callback=t??null,hs(n,o,i),e.current.lanes=i,Fd(e,i,r),Yn(e,r),e}function Iv(e,t,n,r){var i=t.current,o=Rn(),s=ps(i);return n=S$(n),t.context===null?t.context=n:t.pendingContext=n,t=po(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=hs(i,t,s),e!==null&&(hi(e,i,s,o),Tm(e,i,s)),s}function kg(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function iT(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vC(e,t){iT(e,t),(e=e.alternate)&&iT(e,t)}function XH(){return null}var O$=typeof reportError=="function"?reportError:function(e){console.error(e)};function bC(e){this._internalRoot=e}jv.prototype.render=bC.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));Iv(e,t,null,null)};jv.prototype.unmount=bC.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fa(function(){Iv(null,e,null,null)}),t[ko]=null}};function jv(e){this._internalRoot=e}jv.prototype.unstable_scheduleHydration=function(e){if(e){var t=tL();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xo.length&&t!==0&&t<Xo[n].priority;n++);Xo.splice(n,0,e),n===0&&rL(e)}};function xC(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Rv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function oT(){}function YH(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=kg(s);o.call(u)}}var s=k$(t,r,e,0,null,!1,!1,"",oT);return e._reactRootContainer=s,e[ko]=s.current,vh(e.nodeType===8?e.parentNode:e),Fa(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=kg(l);a.call(u)}}var l=yC(e,0,!1,null,null,!1,!1,"",oT);return e._reactRootContainer=l,e[ko]=l.current,vh(e.nodeType===8?e.parentNode:e),Fa(function(){Iv(t,l,n,r)}),l}function Nv(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=kg(s);a.call(l)}}Iv(t,s,e,i)}else s=YH(n,t,e,i,r);return kg(s)}JD=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Pf(t.pendingLanes);n!==0&&(BO(t,n|1),Yn(t,Pt()),!(Ie&6)&&(Mu=Pt()+500,Ls()))}break;case 13:Fa(function(){var r=Oo(e,1);if(r!==null){var i=Rn();hi(r,e,1,i)}}),vC(e,1)}};FO=function(e){if(e.tag===13){var t=Oo(e,134217728);if(t!==null){var n=Rn();hi(t,e,134217728,n)}vC(e,134217728)}};eL=function(e){if(e.tag===13){var t=ps(e),n=Oo(e,t);if(n!==null){var r=Rn();hi(n,e,t,r)}vC(e,t)}};tL=function(){return ze};nL=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}};$1=function(e,t,n){switch(t){case"input":if(M1(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Cv(r);if(!i)throw Error(Z(90));jD(r),M1(r,i)}}}break;case"textarea":ND(e,n);break;case"select":t=n.value,t!=null&&iu(e,!!n.multiple,t,!1)}};WD=dC;UD=Fa;var ZH={usingClientEntryPoint:!1,Events:[Wd,Fl,Cv,FD,zD,dC]},Yc={findFiberByHostInstance:fa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},JH={bundleType:Yc.bundleType,version:Yc.version,rendererPackageName:Yc.rendererPackageName,rendererConfig:Yc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ro.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=qD(e),e===null?null:e.stateNode},findFiberByHostInstance:Yc.findFiberByHostInstance||XH,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pp.isDisabled&&Pp.supportsFiber)try{wv=Pp.inject(JH),$i=Pp}catch{}}Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZH;Cr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xC(t))throw Error(Z(200));return QH(e,t,null,n)};Cr.createRoot=function(e,t){if(!xC(e))throw Error(Z(299));var n=!1,r="",i=O$;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=yC(e,1,!1,null,null,n,!1,r,i),e[ko]=t.current,vh(e.nodeType===8?e.parentNode:e),new bC(t)};Cr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=qD(t),e=e===null?null:e.stateNode,e};Cr.flushSync=function(e){return Fa(e)};Cr.hydrate=function(e,t,n){if(!Rv(t))throw Error(Z(200));return Nv(null,e,t,!0,n)};Cr.hydrateRoot=function(e,t,n){if(!xC(e))throw Error(Z(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=O$;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=k$(t,null,e,1,n??null,i,!1,o,s),e[ko]=t.current,vh(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new jv(t)};Cr.render=function(e,t,n){if(!Rv(t))throw Error(Z(200));return Nv(null,e,t,!1,n)};Cr.unmountComponentAtNode=function(e){if(!Rv(e))throw Error(Z(40));return e._reactRootContainer?(Fa(function(){Nv(null,null,e,!1,function(){e._reactRootContainer=null,e[ko]=null})}),!0):!1};Cr.unstable_batchedUpdates=dC;Cr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Rv(n))throw Error(Z(200));if(e==null||e._reactInternals===void 0)throw Error(Z(38));return Nv(e,t,n,!1,r)};Cr.version="18.3.1-next-f1338f8080-20240426";function C$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C$)}catch(e){console.error(e)}}C$(),CD.exports=Cr;var nl=CD.exports;const eV=De(nl);var yw,sT=nl;yw=sT.createRoot,sT.hydrateRoot;var xc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tV=class extends xc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},wC=new tV,nV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},rV=class{#e=nV;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},pa=new rV;function iV(e){setTimeout(e,0)}var oV=typeof window>"u"||"Deno"in globalThis;function Pn(){}function sV(e,t){return typeof e=="function"?e(t):e}function vw(e){return typeof e=="number"&&e>=0&&e!==1/0}function A$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gs(e,t){return typeof e=="function"?e(t):e}function mr(e,t){return typeof e=="function"?e(t):e}function aT(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==SC(s,t.options))return!1}else if(!Ph(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function lT(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(za(t.options.mutationKey)!==za(o))return!1}else if(!Ph(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function SC(e,t){return(t?.queryKeyHashFn||za)(e)}function za(e){return JSON.stringify(e,(t,n)=>bw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ph(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ph(e[n],t[n])):!1}var aV=Object.prototype.hasOwnProperty;function P$(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=uT(e)&&uT(t);if(!r&&!(bw(e)&&bw(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),a=s.length,l=r?new Array(a):{};let u=0;for(let c=0;c<a;c++){const f=r?c:s[c],h=e[f],d=t[f];if(h===d){l[f]=h,(r?c<o:aV.call(e,f))&&u++;continue}if(h===null||d===null||typeof h!="object"||typeof d!="object"){l[f]=d;continue}const p=P$(h,d,n+1);l[f]=p,p===h&&u++}return o===a&&u===o?e:l}function Og(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function uT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bw(e){if(!cT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!cT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function cT(e){return Object.prototype.toString.call(e)==="[object Object]"}function lV(e){return new Promise(t=>{pa.setTimeout(t,e)})}function xw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?P$(e,t):t}function uV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function cV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var kC=Symbol();function E$(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===kC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function OC(e,t){return typeof e=="function"?e(...t):!!e}function fV(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Eh=(()=>{let e=()=>oV;return{isServer(){return e()},setIsServer(t){e=t}}})();function ww(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var hV=iV;function dV(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=hV;const o=a=>{t?e.push(a):i(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Ft=dV(),pV=class extends xc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Cg=new pV;function mV(e){return Math.min(1e3*2**e,3e4)}function T$(e){return(e??"online")==="online"?Cg.isOnline():!0}var Sw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function _$(e){let t=!1,n=0,r;const i=ww(),o=()=>i.status!=="pending",s=m=>{if(!o()){const y=new Sw(m);h(y),e.onCancel?.(y)}},a=()=>{t=!0},l=()=>{t=!1},u=()=>wC.isFocused()&&(e.networkMode==="always"||Cg.isOnline())&&e.canRun(),c=()=>T$(e.networkMode)&&e.canRun(),f=m=>{o()||(r?.(),i.resolve(m))},h=m=>{o()||(r?.(),i.reject(m))},d=()=>new Promise(m=>{r=y=>{(o()||u())&&m(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),p=()=>{if(o())return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(f).catch(g=>{if(o())return;const v=e.retry??(Eh.isServer()?0:3),x=e.retryDelay??mV,k=typeof x=="function"?x(n,g):x,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,g);if(t||!w){h(g);return}n++,e.onFail?.(n,g),lV(k).then(()=>u()?void 0:d()).then(()=>{t?h(g):p()})})};return{promise:i,status:()=>i.status,cancel:s,continue:()=>(r?.(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?p():d().then(p),i)}}var M$=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vw(this.gcTime)&&(this.#e=pa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Eh.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(pa.clearTimeout(this.#e),this.#e=void 0)}},gV=class extends M${#e;#t;#n;#i;#r;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=hT(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=hT(this.options);t.data!==void 0&&(this.setState(fT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=xw(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#l({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Pn).catch(Pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>mr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===kC||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>gs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!A$(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#s||this.#a()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#a(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const a=E$(this.options,t),u=(()=>{const c={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(c),c})();return this.#s=!1,this.options.persister?this.options.persister(a,u,this):a(u)},s=(()=>{const a={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(a),a})();this.options.behavior?.onFetch(s,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#l({type:"fetch",meta:s.fetchOptions?.meta}),this.#r=_$({initialPromise:t?.initialPromise,fn:s.fetchFn,onCancel:a=>{a instanceof Sw&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(a,l)=>{this.#l({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{const a=await this.#r.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Sw){if(a.silent)return this.#r.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#l({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...I$(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...fT(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ft.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function I$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:T$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var yV=class extends xc{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#s=ww(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#o;#s;#a;#l;#d;#p;#c;#f;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),dT(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kw(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kw(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof mr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Og(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&pT(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||mr(this.options.enabled,this.#t)!==mr(t.enabled,this.#t)||gs(this.options.staleTime,this.#t)!==gs(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||mr(this.options.enabled,this.#t)!==mr(t.enabled,this.#t)||i!==this.#u)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bV(this,n)&&(this.#i=n,this.#o=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Pn)),t}#g(){this.#x();const e=gs(this.options.staleTime,this.#t);if(Eh.isServer()||this.#i.isStale||!vw(e))return;const n=A$(this.#i.dataUpdatedAt,e)+1;this.#c=pa.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#u=e,!(Eh.isServer()||mr(this.options.enabled,this.#t)===!1||!vw(this.#u)||this.#u===0)&&(this.#f=pa.setInterval(()=>{(this.options.refetchIntervalInBackground||wC.isFocused())&&this.#h()},this.#u))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c!==void 0&&(pa.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#f!==void 0&&(pa.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,o=this.#r,s=this.#o,l=e!==n?e.state:this.#n,{state:u}=e;let c={...u},f=!1,h;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&dT(e,t),M=A&&pT(e,n,t,r);(P||M)&&(c={...c,...I$(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:m}=c;h=c.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&m==="pending"){let A;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(A=i.data,y=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,A!==void 0&&(m="success",h=xw(i?.data,A,t),f=!0)}if(t.select&&h!==void 0&&!y)if(i&&h===o?.data&&t.select===this.#l)h=this.#d;else try{this.#l=t.select,h=t.select(h),h=xw(i?.data,h,t),this.#d=h,this.#a=null}catch(A){this.#a=A}this.#a&&(d=this.#a,h=this.#d,p=Date.now(),m="error");const g=c.fetchStatus==="fetching",v=m==="pending",x=m==="error",k=v&&g,w=h!==void 0,O={status:m,fetchStatus:c.fetchStatus,isPending:v,isSuccess:m==="success",isError:x,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:x&&!w,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&w,isStale:CC(e,t),refetch:this.refetch,promise:this.#s,isEnabled:mr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=O.data!==void 0,P=O.status==="error"&&!A,M=R=>{P?R.reject(O.error):A&&R.resolve(O.data)},_=()=>{const R=this.#s=O.promise=ww();M(R)},E=this.#s;switch(E.status){case"pending":e.queryHash===n.queryHash&&M(E);break;case"fulfilled":(P||O.data!==E.value)&&_();break;case"rejected":(!P||O.error!==E.reason)&&_();break}}return O}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#p=this.#t),Og(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const o=new Set(i??this.#m);return this.options.throwOnError&&o.add("error"),Object.keys(this.#i).some(s=>{const a=s;return this.#i[a]!==e[a]&&o.has(a)})};this.#k({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#k(e){Ft.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function vV(e,t){return mr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&mr(t.retryOnMount,e)===!1)}function dT(e,t){return vV(e,t)||e.state.data!==void 0&&kw(e,t,t.refetchOnMount)}function kw(e,t,n){if(mr(t.enabled,e)!==!1&&gs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&CC(e,t)}return!1}function pT(e,t,n,r){return(e!==t||mr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&CC(e,n)}function CC(e,t){return mr(t.enabled,e)!==!1&&e.isStaleByTime(gs(t.staleTime,e))}function bV(e,t){return!Og(e.getCurrentResult(),t)}function mT(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let c=!1;const f=p=>{fV(p,()=>t.signal,()=>c=!0)},h=E$(t.options,t.fetchOptions),d=async(p,m,y)=>{if(c)return Promise.reject();if(m==null&&p.pages.length)return Promise.resolve(p);const v=(()=>{const S={client:t.client,queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};return f(S),S})(),x=await h(v),{maxPages:k}=t.options,w=y?cV:uV;return{pages:w(p.pages,x,k),pageParams:w(p.pageParams,m,k)}};if(i&&o.length){const p=i==="backward",m=p?xV:gT,y={pages:o,pageParams:s},g=m(r,y);a=await d(y,g,p)}else{const p=e??o.length;do{const m=l===0?s[0]??r.initialPageParam:gT(r,a);if(l>0&&m==null)break;a=await d(a,m),l++}while(l<p)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function gT(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function xV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var wV=class extends M${#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||j$(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=_$({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#r({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const s=await this.options.onMutate?.(e,n);s!==this.state.context&&this.#r({type:"pending",context:s,variables:e,isPaused:i})}const o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(s){Promise.reject(s)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(s){Promise.reject(s)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(s){Promise.reject(s)}throw this.#r({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ft.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function j$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var SV=class extends xc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new wV({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ep(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ep(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ep(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Ep(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ft.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>lT(t,n))}findAll(e={}){return this.getAll().filter(t=>lT(e,t))}notify(e){Ft.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ft.batch(()=>Promise.all(e.map(t=>t.continue().catch(Pn))))}};function Ep(e){return e.options.scope?.id}var kV=class extends xc{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Og(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&za(n.mutationKey)!==za(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??j$();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Ft.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},OV=class extends xc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??SC(r,t);let o=this.get(i);return o||(o=new gV({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ft.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>aT(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>aT(e,n)):t}notify(e){Ft.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ft.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ft.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},CV=class{#e;#t;#n;#i;#r;#o;#s;#a;constructor(e={}){this.#e=e.queryCache||new OV,this.#t=e.mutationCache||new SV,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=wC.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Cg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(gs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,s=sV(t,o);if(s!==void 0)return this.#e.build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ft.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Ft.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ft.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ft.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pn).catch(Pn)}invalidateQueries(e,t={}){return Ft.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ft.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(gs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pn).catch(Pn)}fetchInfiniteQuery(e){return e.behavior=mT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pn).catch(Pn)}ensureInfiniteQueryData(e){return e.behavior=mT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Cg.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(za(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Ph(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(za(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Ph(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=SC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===kC&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},R$=C.createContext(void 0),Qi=e=>{const t=C.useContext(R$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},AV=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(R$.Provider,{value:e,children:t})),N$=C.createContext(!1),PV=()=>C.useContext(N$);N$.Provider;function EV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var TV=C.createContext(EV()),_V=()=>C.useContext(TV),MV=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?OC(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},IV=e=>{C.useEffect(()=>{e.clearReset()},[e])},jV=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||OC(n,[e.error,r])),RV=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},NV=(e,t)=>e.isLoading&&e.isFetching&&!t,DV=(e,t)=>e?.suspense&&t.isPending,yT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function LV(e,t,n){const r=PV(),i=_V(),o=Qi(),s=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(s);const a=o.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",RV(s),MV(s,i,a),IV(i);const l=!o.getQueryCache().get(s.queryHash),[u]=C.useState(()=>new t(o,s)),c=u.getOptimisticResult(s),f=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(h=>{const d=f?u.subscribe(Ft.batchCalls(h)):Pn;return u.updateResult(),d},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setOptions(s)},[s,u]),DV(s,c))throw yT(s,u,i);if(jV({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:a,suspense:s.suspense}))throw c.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(s,c),s.experimental_prefetchInRender&&!Eh.isServer()&&NV(c,r)&&(l?yT(s,u,i):a?.promise)?.catch(Pn).finally(()=>{u.updateResult()}),s.notifyOnChangeProps?c:u.trackResult(c)}function Jt(e,t){return LV(e,yV)}function Wa(e,t){const n=Qi(),[r]=C.useState(()=>new kV(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(s=>r.subscribe(Ft.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=C.useCallback((s,a)=>{r.mutate(s,a).catch(Pn)},[r]);if(i.error&&OC(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Tf=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Nb(e){const t=C.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function $V(e,t,n={},r={}){C.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([o])=>{t(o)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function BV(e){const t=C.useRef(null);return C.useImperativeHandle(e,()=>t.current,[]),t}var D$=!1;function Th(e){return e[e.length-1]}function FV(e){return typeof e=="function"}function ns(e,t){return FV(e)?e(t):e}var zV=Object.prototype.hasOwnProperty,vT=Object.prototype.propertyIsEnumerable,WV=()=>Object.create(null),Qs=(e,t)=>rs(e,t,WV);function rs(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,o=wT(e)&&wT(i);if(!o&&!(Iu(e)&&Iu(i)))return i;const s=o?e:bT(e);if(!s)return i;const a=o?i:bT(i);if(!a)return i;const l=s.length,u=a.length,c=o?new Array(u):n();let f=0;for(let h=0;h<u;h++){const d=o?h:a[h],p=e[d],m=i[d];if(p===m){c[d]=p,(o?h<l:zV.call(e,d))&&f++;continue}if(p===null||m===null||typeof p!="object"||typeof m!="object"){c[d]=m;continue}const y=rs(p,m,n,r+1);c[d]=y,y===p&&f++}return l===u&&f===l?e:c}function bT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!vT.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!vT.call(e,i))return!1;r.push(i)}return r}function Iu(e){if(!xT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!xT(n)||!n.hasOwnProperty("isPrototypeOf"))}function xT(e){return Object.prototype.toString.call(e)==="[object Object]"}function wT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pa(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Pa(e[r],t[r],n))return!1;return!0}if(Iu(e)&&Iu(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const s in t)if((!r||t[s]!==void 0)&&!Pa(e[s],t[s],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const s in e)e[s]!==void 0&&i++;let o=0;for(const s in t)if((!r||t[s]!==void 0)&&(o++,o>i||!Pa(e[s],t[s],n)))return!1;return i===o}return!1}function ju(e){let t,n;const r=new Promise((i,o)=>{t=i,n=o});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function _h(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function UV(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function ST(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return UV(t)}var HV=["http:","https:","mailto:","tel:"];function Ag(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Zc(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",i;for(;(i=t.exec(e))!==null;)r+=ST(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+ST(n?e.slice(n):e);let o=!1;return r.startsWith("//")&&(o=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:o}}function VV(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function qV(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function mo(){throw new Error("Invariant failed")}function Mh(e){const t=new Map;let n,r;const i=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const s=t.get(o);if(s)return i(s),s.value},set(o,s){if(t.size>=e&&n){const l=n;t.delete(l.key),l.next&&(n=l.next,l.next.prev=void 0),l===r&&(r=void 0)}const a=t.get(o);if(a)a.value=s,i(a);else{const l={key:o,value:s,prev:r};r&&(r.next=l),r=l,n||(n=l),t.set(o,l)}},clear(){t.clear(),n=void 0,r=void 0}}}var ma=4,L$=5;function KV(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function AC(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,o=e.substring(t,i);if(!o||!o.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(o==="$"){const a=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=a,n[4]=a,n[5]=a,n}if(o.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const s=KV(o);if(s){const[a,l]=s,u=o.charCodeAt(a+1);if(u===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const c=a+3,f=l;if(c<f)return n[0]=3,n[1]=t+a,n[2]=t+c,n[3]=t+f,n[4]=t+l+1,n[5]=i,n}}else if(u===36){const c=a+1,f=a+2;return f===l?(n[0]=2,n[1]=t+a,n[2]=t+c,n[3]=t+f,n[4]=t+l+1,n[5]=e.length,n):(n[0]=1,n[1]=t+a,n[2]=t+f,n[3]=t+l,n[4]=t+l+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Dv(e,t,n,r,i,o,s){s?.(n);let a=r;{const l=n.fullPath??n.from,u=l.length,c=n.options?.caseSensitive??e,f=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;a<u;){const d=AC(l,a,t);let p;const m=a,y=d[5];switch(a=y+1,o++,d[0]){case 0:{const g=l.substring(d[2],d[3]);if(c){const v=i.static?.get(g);if(v)p=v;else{i.static??=new Map;const x=ga(n.fullPath??n.from);x.parent=i,x.depth=o,p=x,i.static.set(g,x)}}else{const v=g.toLowerCase(),x=i.staticInsensitive?.get(v);if(x)p=x;else{i.staticInsensitive??=new Map;const k=ga(n.fullPath??n.from);k.parent=i,k.depth=o,p=k,i.staticInsensitive.set(v,k)}}break}case 1:{const g=l.substring(m,d[1]),v=l.substring(d[4],y),x=c&&!!(g||v),k=g?x?g:g.toLowerCase():void 0,w=v?x?v:v.toLowerCase():void 0,S=!f&&i.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===x&&O.prefix===k&&O.suffix===w);if(S)p=S;else{const O=Lb(1,n.fullPath??n.from,x,k,w);p=O,O.depth=o,O.parent=i,i.dynamic??=[],i.dynamic.push(O)}break}case 3:{const g=l.substring(m,d[1]),v=l.substring(d[4],y),x=c&&!!(g||v),k=g?x?g:g.toLowerCase():void 0,w=v?x?v:v.toLowerCase():void 0,S=!f&&i.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===x&&O.prefix===k&&O.suffix===w);if(S)p=S;else{const O=Lb(3,n.fullPath??n.from,x,k,w);p=O,O.parent=i,O.depth=o,i.optional??=[],i.optional.push(O)}break}case 2:{const g=l.substring(m,d[1]),v=l.substring(d[4],y),x=c&&!!(g||v),k=g?x?g:g.toLowerCase():void 0,w=v?x?v:v.toLowerCase():void 0,S=Lb(2,n.fullPath??n.from,x,k,w);p=S,S.parent=i,S.depth=o,i.wildcard??=[],i.wildcard.push(S)}}i=p}if(f&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const d=ga(n.fullPath??n.from);d.kind=L$,d.parent=i,o++,d.depth=o,i.pathless??=[],i.pathless.push(d),i=d}const h=(n.path||!n.children)&&!n.isRoot;if(h&&l.endsWith("/")){const d=ga(n.fullPath??n.from);d.kind=ma,d.parent=i,o++,d.depth=o,i.index=d,i=d}i.parse=n.options?.params?.parse??null,i.skipOnParamError=f,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,h&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const l of n.children)Dv(e,t,l,a,i,o,s)}function Db(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qo(e){if(e.pathless)for(const t of e.pathless)qo(t);if(e.static)for(const t of e.static.values())qo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())qo(t);if(e.dynamic?.length){e.dynamic.sort(Db);for(const t of e.dynamic)qo(t)}if(e.optional?.length){e.optional.sort(Db);for(const t of e.optional)qo(t)}if(e.wildcard?.length){e.wildcard.sort(Db);for(const t of e.wildcard)qo(t)}}function ga(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Lb(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function GV(e,t){const n=ga("/"),r=new Uint16Array(6);for(const i of e)Dv(!1,r,i,1,n,0);qo(n),t.masksTree=n,t.flatCache=Mh(1e3)}function QV(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=PC(e,t.masksTree);return t.flatCache.set(e,r),r}function XV(e,t,n,r,i){e||="/",r||="/";const o=t?`case\0${e}`:e;let s=i.singleCache.get(o);return s||(s=ga("/"),Dv(t,new Uint16Array(6),{from:e},1,s,0),i.singleCache.set(o,s)),PC(r,s,n)}function YV(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let o;try{o=PC(e,t.segmentTree,n)}catch(s){if(s instanceof URIError)o=null;else throw s}return o&&(o.branch=e7(o.route)),t.matchCache.set(r,o),o}function ZV(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function JV(e,t=!1,n){const r=ga(e.fullPath),i=new Uint16Array(6),o={},s={};let a=0;return Dv(t,i,e,1,r,0,l=>{if(n?.(l,a),l.id in o&&mo(),o[l.id]=l,a!==0&&l.path){const u=ZV(l.fullPath);(!s[u]||l.fullPath.endsWith("/"))&&(s[u]=l)}a++}),qo(r),{processedTree:{segmentTree:r,singleCache:Mh(1e3),matchCache:Mh(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function PC(e,t,n=!1){const r=e.split("/"),i=n7(e,r,t,n);if(!i)return null;const[o]=$$(e,r,i);return{route:i.node.route,rawParams:o,parsedParams:i.parsedParams}}function $$(e,t,n){const r=t7(n.node);let i=null;const o=Object.create(null);let s=n.extract?.part??0,a=n.extract?.node??0,l=n.extract?.path??0,u=n.extract?.segment??0;for(;a<r.length;s++,a++,l++,u++){const c=r[a];if(c.kind===ma)break;if(c.kind===L$){u--,s--,l--;continue}const f=t[s],h=l;if(f&&(l+=f.length),c.kind===1){i??=n.node.fullPath.split("/");const d=i[u],p=c.prefix?.length??0;if(d.charCodeAt(p)===123){const m=c.suffix?.length??0,y=d.substring(p+2,d.length-m-1),g=f.substring(p,f.length-m);o[y]=decodeURIComponent(g)}else{const m=d.substring(1);o[m]=decodeURIComponent(f)}}else if(c.kind===3){if(n.skipped&1<<a){s--,l=h-1;continue}i??=n.node.fullPath.split("/");const d=i[u],p=c.prefix?.length??0,m=c.suffix?.length??0,y=d.substring(p+3,d.length-m-1),g=c.suffix||c.prefix?f.substring(p,f.length-m):f;g&&(o[y]=decodeURIComponent(g))}else if(c.kind===2){const d=c,p=e.substring(h+(d.prefix?.length??0),e.length-(d.suffix?.length??0)),m=decodeURIComponent(p);o["*"]=m,o._splat=m;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:s,node:a,path:l,segment:u}]}function e7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function t7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function n7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Th(t),o=i&&e!=="/",s=t.length-(i?1:0),a=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,u=null,c=null;for(;a.length;){const f=a.pop(),{node:h,index:d,skipped:p,depth:m,statics:y,dynamics:g,optionals:v}=f;let{extract:x,rawParams:k,parsedParams:w}=f;if(h.skipOnParamError){if(!$b(e,t,f))continue;k=f.rawParams,x=f.extract,w=f.parsedParams}r&&h.route&&h.kind!==ma&&Jc(u,f)&&(u=f);const S=d===s;if(S&&(h.route&&!o&&Jc(c,f)&&(c=f),!h.optional&&!h.wildcard&&!h.index&&!h.pathless))continue;const O=S?void 0:t[d];let A;if(S&&h.index){const P={node:h.index,index:d,skipped:p,depth:m+1,statics:y,dynamics:g,optionals:v,extract:x,rawParams:k,parsedParams:w};let M=!0;if(h.index.skipOnParamError&&($b(e,t,P)||(M=!1)),M){if(y===s&&!g&&!v&&!p)return P;Jc(c,P)&&(c=P)}}if(h.wildcard&&Jc(l,f))for(const P of h.wildcard){const{prefix:M,suffix:_}=P;if(M&&(S||!(P.caseSensitive?O:A??=O.toLowerCase()).startsWith(M)))continue;if(_){if(S)continue;const R=t.slice(d).join("/").slice(-_.length);if((P.caseSensitive?R:R.toLowerCase())!==_)continue}const E={node:P,index:s,skipped:p,depth:m,statics:y,dynamics:g,optionals:v,extract:x,rawParams:k,parsedParams:w};if(!(P.skipOnParamError&&!$b(e,t,E))){l=E;break}}if(h.optional){const P=p|1<<m,M=m+1;for(let _=h.optional.length-1;_>=0;_--){const E=h.optional[_];a.push({node:E,index:d,skipped:P,depth:M,statics:y,dynamics:g,optionals:v,extract:x,rawParams:k,parsedParams:w})}if(!S)for(let _=h.optional.length-1;_>=0;_--){const E=h.optional[_],{prefix:R,suffix:N}=E;if(R||N){const j=E.caseSensitive?O:A??=O.toLowerCase();if(R&&!j.startsWith(R)||N&&!j.endsWith(N))continue}a.push({node:E,index:d+1,skipped:p,depth:M,statics:y,dynamics:g,optionals:v+1,extract:x,rawParams:k,parsedParams:w})}}if(!S&&h.dynamic&&O)for(let P=h.dynamic.length-1;P>=0;P--){const M=h.dynamic[P],{prefix:_,suffix:E}=M;if(_||E){const R=M.caseSensitive?O:A??=O.toLowerCase();if(_&&!R.startsWith(_)||E&&!R.endsWith(E))continue}a.push({node:M,index:d+1,skipped:p,depth:m+1,statics:y,dynamics:g+1,optionals:v,extract:x,rawParams:k,parsedParams:w})}if(!S&&h.staticInsensitive){const P=h.staticInsensitive.get(A??=O.toLowerCase());P&&a.push({node:P,index:d+1,skipped:p,depth:m+1,statics:y+1,dynamics:g,optionals:v,extract:x,rawParams:k,parsedParams:w})}if(!S&&h.static){const P=h.static.get(O);P&&a.push({node:P,index:d+1,skipped:p,depth:m+1,statics:y+1,dynamics:g,optionals:v,extract:x,rawParams:k,parsedParams:w})}if(h.pathless){const P=m+1;for(let M=h.pathless.length-1;M>=0;M--){const _=h.pathless[M];a.push({node:_,index:d,skipped:p,depth:P,statics:y,dynamics:g,optionals:v,extract:x,rawParams:k,parsedParams:w})}}}if(c&&l)return Jc(l,c)?c:l;if(c)return c;if(l)return l;if(r&&u){let f=u.index;for(let d=0;d<u.index;d++)f+=t[d].length;const h=f===e.length?"/":e.slice(f);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(h),u}return null}function $b(e,t,n){try{const[r,i]=$$(e,t,n);n.rawParams=r,n.extract=i;const o=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,o),!0}catch{return null}}function Jc(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ma)>(e.node.kind===ma)||t.node.kind===ma==(e.node.kind===ma)&&t.depth>e.depth))):!0}function Dm(e){return EC(e.filter(t=>t!==void 0).join("/"))}function EC(e){return e.replace(/\/{2,}/g,"/")}function B$(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ys(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function F$(e){return ys(B$(e))}function Pg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function r7(e,t,n){return Pg(e,n)===Pg(t,n)}function i7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),o=!i&&t===".";let s;if(r){s=i?t:o?e:e+"\0"+t;const f=r.get(s);if(f)return f}let a;if(o)a=e.split("/");else if(i)a=t.split("/");else{for(a=e.split("/");a.length>1&&Th(a)==="";)a.pop();const f=t.split("/");for(let h=0,d=f.length;h<d;h++){const p=f[h];p===""?h?h===d-1&&a.push(p):a=[p]:p===".."?a.pop():p==="."||a.push(p)}}a.length>1&&(Th(a)===""?n==="never"&&a.pop():n==="always"&&a.push(""));let l,u="";for(let f=0;f<a.length;f++){f>0&&(u+="/");const h=a[f];if(!h)continue;l=AC(h,0,l);const d=l[0];if(d===0){u+=h;continue}const p=l[5],m=h.substring(0,l[1]),y=h.substring(l[4],p),g=h.substring(l[2],l[3]);d===1?u+=m||y?`${m}{$${g}}${y}`:`$${g}`:d===2?u+=m||y?`${m}{$}${y}`:"$":u+=`${m}{-$${g}}${y}`}u=EC(u);const c=u||"/";return s&&r&&r.set(s,c),c}function o7(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,o=>t.get(o)??o)}function Bb(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>OT(i,n)).join("/"):OT(r,n)}function kT({path:e,params:t,decoder:n,...r}){let i=!1;const o=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:i};const s=e.length;let a=0,l,u="";for(;a<s;){const c=a;l=AC(e,c,l);const f=l[5];if(a=f+1,c===f)continue;const h=l[0];if(h===0){u+="/"+e.substring(c,f);continue}if(h===2){const d=t._splat;o._splat=d,o["*"]=d;const p=e.substring(c,l[1]),m=e.substring(l[4],f);if(!d){i=!0,(p||m)&&(u+="/"+p+m);continue}const y=Bb("_splat",t,n);u+="/"+p+y+m;continue}if(h===1){const d=e.substring(l[2],l[3]);!i&&!(d in t)&&(i=!0),o[d]=t[d];const p=e.substring(c,l[1]),m=e.substring(l[4],f),y=Bb(d,t,n)??"undefined";u+="/"+p+y+m;continue}if(h===3){const d=e.substring(l[2],l[3]),p=t[d];if(p==null)continue;o[d]=p;const m=e.substring(c,l[1]),y=e.substring(l[4],f),g=Bb(d,t,n)??"";u+="/"+m+g+y;continue}}return e.endsWith("/")&&(u+="/"),{usedParams:o,interpolatedPath:u||"/",isMissingParams:i}}function OT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function vn(e){return e?.isNotFound===!0}function s7(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}var a7="tsr-scroll-restoration-v1_3";function l7(){const e=s7();if(!e)return null;let t={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");Iu(r)&&(t=r)}catch{}return{get state(){return t},set:r=>{t=ns(r,t)||t},persist:()=>{try{e.setItem(a7,JSON.stringify(t))}catch{}}}}var CT=l7(),u7=e=>e.state.__TSR_key||e.href;function c7(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}var Tp=!1,ef="window",AT="data-scroll-restoration-id";function f7(e,t){if(!CT)return;const n=CT;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,Tp=!1;const r=e.options.getScrollRestorationKey||u7,i=new Map;window.history.scrollRestoration="manual";const o=a=>{if(!(Tp||!e.isScrollRestoring))if(a.target===document||a.target===window)i.set(ef,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const l=a.target;i.set(l,{scrollX:l.scrollLeft||0,scrollY:l.scrollTop||0})}},s=a=>{if(!e.isScrollRestoring||!a||i.size===0||!n)return;const l=n.state[a]||={};for(const[u,c]of i){let f;if(u===ef)f=ef;else if(u.isConnected){const h=u.getAttribute(AT);f=h?`[${AT}="${h}"]`:c7(u)}f&&(l[f]=c)}};document.addEventListener("scroll",o,!0),e.subscribe("onBeforeLoad",a=>{s(a.fromLocation?r(a.fromLocation):void 0),i.clear()}),window.addEventListener("pagehide",()=>{s(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe("onRendered",a=>{const l=r(a.toLocation),u=e.options.scrollRestorationBehavior,c=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Tp=!0;try{const f=e.isScrollRestoring?n.state[l]:void 0;let h=!1;if(f)for(const d in f){const p=f[d];if(!Iu(p))continue;const{scrollX:m,scrollY:y}=p;if(!(!Number.isFinite(m)||!Number.isFinite(y))){if(d===ef)window.scrollTo({top:y,left:m,behavior:u}),h=!0;else if(d){let g;try{g=document.querySelector(d)}catch{continue}g&&(g.scrollLeft=m,g.scrollTop=y,h=!0)}}}if(!h){const d=e.history.location.hash.slice(1);if(d){const p=window.history.state?.__hashScrollIntoViewOptions??!0;if(p){const m=document.getElementById(d);m&&m.scrollIntoView(p)}}else{const p={top:0,left:0,behavior:u};if(window.scrollTo(p),c)for(const m of c){if(m===ef)continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}}}finally{Tp=!1}e.isScrollRestoring&&n.set(f=>(f[l]||={},f))}})}function h7(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Fb(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function d7(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const o=n[r];o==null?n[r]=Fb(i):Array.isArray(o)?o.push(Fb(i)):n[r]=[o,Fb(i)]}return n}var p7=g7(JSON.parse),m7=y7(JSON.stringify,JSON.parse);function g7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=d7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function y7(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const o=h7(i,r);return o?`?${o}`:""}}var Ea="__root__";function v7(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Hn(e){return e instanceof Response&&!!e.options}function b7(e){return{input:({url:t})=>{for(const n of e)t=Ow(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=z$(e[n],t);return t}}}function x7(e){const t=F$(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:s})=>{const a=e.caseSensitive?s.pathname:s.pathname.toLowerCase();return a===i?s.pathname="/":a.startsWith(o)&&(s.pathname=s.pathname.slice(n.length)),s},output:({url:s})=>(s.pathname=Dm(["/",t,s.pathname]),s)}}function Ow(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function z$(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function w7(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:i,init:o}=t,s=new Map,a=new Map,l=new Map,u=n(e.status),c=n(e.loadedAt),f=n(e.isLoading),h=n(e.isTransitioning),d=n(e.location),p=n(e.resolvedLocation),m=n(e.statusCode),y=n(e.redirect),g=n([]),v=n([]),x=n([]),k=r(()=>zb(s,g.get())),w=r(()=>zb(a,v.get())),S=r(()=>zb(l,x.get())),O=r(()=>g.get()[0]),A=r(()=>g.get().some(F=>s.get(F)?.get().status==="pending")),P=r(()=>({locationHref:d.get().href,resolvedLocationHref:p.get()?.href,status:u.get()})),M=r(()=>({status:u.get(),loadedAt:c.get(),isLoading:f.get(),isTransitioning:h.get(),matches:k.get(),location:d.get(),resolvedLocation:p.get(),statusCode:m.get(),redirect:y.get()})),_=Mh(64);function E(F){let $=_.get(F);return $||($=r(()=>{const z=g.get();for(const T of z){const q=s.get(T);if(q&&q.routeId===F)return q.get()}}),_.set(F,$)),$}const R={status:u,loadedAt:c,isLoading:f,isTransitioning:h,location:d,resolvedLocation:p,statusCode:m,redirect:y,matchesId:g,pendingIds:v,cachedIds:x,matches:k,pendingMatches:w,cachedMatches:S,firstId:O,hasPending:A,matchRouteDeps:P,matchStores:s,pendingMatchStores:a,cachedMatchStores:l,__store:M,getRouteMatchStore:E,setMatches:N,setPending:j,setCached:B};N(e.matches),o?.(R);function N(F){Wb(F,s,g,n,i)}function j(F){Wb(F,a,v,n,i)}function B(F){Wb(F,l,x,n,i)}return R}function zb(e,t){const n=[];for(const r of t){const i=e.get(r);i&&n.push(i.get())}return n}function Wb(e,t,n,r,i){const o=e.map(a=>a.id),s=new Set(o);i(()=>{for(const a of t.keys())s.has(a)||t.delete(a);for(const a of e){const l=t.get(a.id);if(!l){const u=r(a);u.routeId=a.routeId,t.set(a.id,u);continue}l.routeId=a.routeId,l.get()!==a&&l.set(a)}qV(n.get(),o)||n.set(o)})}var Cw=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},S7=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Lv=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ta=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let o=0;o<=i;o++){const s=e.matches[o];if(!s)continue;const a=e.router.getMatch(s.id);a&&Object.assign(r,a.__routeContext,a.__beforeLoadContext)}return r},PT=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(s=>s.routeId===e.router.routeTree.id),i=r>=0?r:0;let o=n?e.matches.findIndex(s=>s.routeId===n):e.firstBadMatchIndex??e.matches.length-1;o<0&&(o=i);for(let s=o;s>=0;s--){const a=e.matches[s];if(e.router.looseRoutesById[a.routeId].options.notFoundComponent)return s}return n?o:i},is=(e,t,n)=>{if(!(!Hn(n)&&!vn(n)))throw Hn(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Hn(n)?"redirected":vn(n)?"notFound":r.status==="pending"?"success":r.status,context:Ta(e,t.index),isFetching:!1,error:n})),vn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Hn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},W$=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},ET=(e,t,n)=>{const r=Ta(e,n);e.updateMatch(t,i=>({...i,context:r}))},tf=(e,t,n,r)=>{const{id:i,routeId:o}=e.matches[t],s=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,is(e,e.router.getMatch(i),n);try{s.options.onError?.(n)}catch(a){n=a,is(e,e.router.getMatch(i),n)}e.updateMatch(i,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Hn(n)&&!vn(n)&&(e.serialError??=n)},U$=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Lv(e,t)&&(n.options.loader||n.options.beforeLoad||V$(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const o=setTimeout(()=>{Cw(e)},i);r._nonReactive.pendingTimeout=o}},k7=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;U$(e,t,n,r);const i=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&is(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},O7=(e,t,n,r)=>{const i=e.router.getMatch(t);let o=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ju(()=>{o?.resolve(),o=void 0});const{paramsError:s,searchError:a}=i;s&&tf(e,n,s,"PARSE_PARAMS"),a&&tf(e,n,a,"VALIDATE_SEARCH"),U$(e,t,r,i);const l=new AbortController;let u=!1;const c=()=>{u||(u=!0,e.updateMatch(t,k=>({...k,isFetching:"beforeLoad",fetchCount:k.fetchCount+1,abortController:l})))},f=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,k=>({...k,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{c(),f()});return}i._nonReactive.beforeLoadPromise=ju();const h={...Ta(e,n,!1),...i.__routeContext},{search:d,params:p,cause:m}=i,y=Lv(e,t),g={search:d,abortController:l,params:p,preload:y,context:h,location:e.location,navigate:k=>e.router.navigate({...k,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:y?"preload":m,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=k=>{if(k===void 0){e.router.batch(()=>{c(),f()});return}(Hn(k)||vn(k))&&(c(),tf(e,n,k,"BEFORE_LOAD")),e.router.batch(()=>{c(),e.updateMatch(t,w=>({...w,__beforeLoadContext:k})),f()})};let x;try{if(x=r.options.beforeLoad(g),_h(x))return c(),x.catch(k=>{tf(e,n,k,"BEFORE_LOAD")}).then(v)}catch(k){c(),tf(e,n,k,"BEFORE_LOAD")}v(x)},C7=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],o=()=>a(),s=()=>O7(e,n,t,i),a=()=>{if(W$(e,n))return;const l=k7(e,n,i);return _h(l)?l.then(s):s()};return o()},A7=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([o,s,a])=>({meta:o?.meta,links:o?.links,headScripts:o?.scripts,headers:a,scripts:s,styles:o?.styles}))},H$=(e,t,n,r,i)=>{const o=t[r-1],{params:s,loaderDeps:a,abortController:l,cause:u}=e.router.getMatch(n),c=Ta(e,r),f=Lv(e,n);return{params:s,deps:a,preload:!!f,parentMatchPromise:o,abortController:l,context:c,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:f?"preload":u,route:i,...e.router.options.additionalContext}},TT=async(e,t,n,r,i)=>{try{const o=e.router.getMatch(n);try{(!(D$??e.router.isServer)||o.ssr===!0)&&Ih(i);const s=i.options.loader,a=typeof s=="function"?s:s?.handler,l=a?.(H$(e,t,n,r,i)),u=!!a&&_h(l);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,f=>({...f,isFetching:"loader"})),a){const f=u?await l:l;is(e,e.router.getMatch(n),f),f!==void 0&&e.updateMatch(n,h=>({...h,loaderData:f}))}i._lazyPromise&&await i._lazyPromise;const c=o._nonReactive.minPendingPromise;c&&await c,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,f=>({...f,error:void 0,context:Ta(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(s){let a=s;if(a?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,u=>({...u,status:u.status==="pending"?"success":u.status,isFetching:!1,context:Ta(e,r)}));return}const l=o._nonReactive.minPendingPromise;l&&await l,vn(s)&&await i.options.notFoundComponent?.preload?.(),is(e,e.router.getMatch(n),s);try{i.options.onError?.(s)}catch(u){a=u,is(e,e.router.getMatch(n),u)}!Hn(a)&&!vn(a)&&await Ih(i,["errorComponent"]),e.updateMatch(n,u=>({...u,error:a,context:Ta(e,r),status:"error",isFetching:!1}))}}catch(o){const s=e.router.getMatch(n);s&&(s._nonReactive.loaderPromise=void 0),is(e,s,o)}},P7=async(e,t,n)=>{async function r(d,p,m,y,g){const v=Date.now()-p.updatedAt,x=d?g.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:g.options.staleTime??e.router.options.defaultStaleTime??0,k=g.options.shouldReload,w=typeof k=="function"?k(H$(e,t,i,n,g)):k,{status:S,invalid:O}=y,A=v>=x&&(!!e.forceStaleReload||y.cause==="enter"||m!==void 0&&m!==y.id);s=S==="success"&&(O||(w??A)),d&&g.options.preload===!1||(s&&!e.sync&&c?(a=!0,(async()=>{try{await TT(e,t,i,n,g);const P=e.router.getMatch(i);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Hn(P)&&await e.router.navigate(P.options)}})()):S!=="success"||s?await TT(e,t,i,n,g):ET(e,i,n))}const{id:i,routeId:o}=e.matches[n];let s=!1,a=!1;const l=e.router.looseRoutesById[o],u=l.options.loader,c=((typeof u=="function"?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(W$(e,i)){if(!e.router.getMatch(i))return e.matches[n];ET(e,i,n)}else{const d=e.router.getMatch(i),p=e.router.stores.matchesId.get()[n],m=(p&&e.router.stores.matchStores.get(p)||null)?.routeId===o?p:e.router.stores.matches.get().find(g=>g.routeId===o)?.id,y=Lv(e,i);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload&&c)return d;await d._nonReactive.loaderPromise;const g=e.router.getMatch(i),v=g._nonReactive.error||g.error;v&&is(e,g,v),g.status==="pending"&&await r(y,d,m,g,l)}else{const g=y&&!e.router.stores.matchStores.has(i),v=e.router.getMatch(i);v._nonReactive.loaderPromise=ju(),g!==v.preload&&e.updateMatch(i,x=>({...x,preload:g})),await r(y,d,m,v,l)}}const f=e.router.getMatch(i);a||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,a||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=a?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,d=>({...d,isFetching:h,invalid:!1})),e.router.getMatch(i)):f};async function _T(e){const t=e,n=[];S7(t.router)&&Cw(t);let r;for(let h=0;h<t.matches.length;h++){try{const d=C7(t,h);_h(d)&&await d}catch(d){if(Hn(d))throw d;if(vn(d))r=d;else if(!t.preload)throw d;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,o=r&&!t.preload?PT(t,r):void 0,s=r&&t.preload?0:o!==void 0?Math.min(o+1,i):i;let a,l;for(let h=0;h<s;h++)n.push(P7(t,n,h));try{await Promise.all(n)}catch{const h=await Promise.allSettled(n);for(const d of h){if(d.status!=="rejected")continue;const p=d.reason;if(Hn(p))throw p;vn(p)?a??=p:l??=p}if(l!==void 0)throw l}const u=a??(r&&!t.preload?r:void 0);let c=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!u&&r&&t.preload)return t.matches;if(u){const h=PT(t,u);h===void 0&&mo();const d=t.matches[h],p=t.router.looseRoutesById[d.routeId],m=t.router.options?.defaultNotFoundComponent;!p.options.notFoundComponent&&m&&(p.options.notFoundComponent=m),u.routeId=d.routeId;const y=d.routeId===t.router.routeTree.id;t.updateMatch(d.id,g=>({...g,...y?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:u},isFetching:!1})),c=h,await Ih(p,["notFoundComponent"])}else if(!t.preload){const h=t.matches[0];h.globalNotFound||t.router.getMatch(h.id)?.globalNotFound&&t.updateMatch(h.id,d=>({...d,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const h=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Ih(h,["errorComponent"])}for(let h=0;h<=c;h++){const{id:d,routeId:p}=t.matches[h],m=t.router.looseRoutesById[p];try{const y=A7(t,d,m);if(y){const g=await y;t.updateMatch(d,v=>({...v,...g}))}}catch(y){console.error(`Error executing head for route ${p}:`,y)}}const f=Cw(t);if(_h(f)&&await f,u)throw u;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function MT(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Ih(e,t=Lm){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...o}=r.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Lm?(()=>{if(e._componentsPromise===void 0){const r=MT(e,Lm);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():MT(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function V$(e){for(const t of Lm)if(e.options[t]?.preload)return!0;return!1}var Lm=["component","errorComponent","pendingComponent","notFoundComponent"],vs="__TSR_index",IT="popstate",jT="beforeunload";function E7(e){let t=e.getLocation();const n=new Set,r=s=>{t=e.getLocation(),n.forEach(a=>a({location:t,action:s}))},i=s=>{e.notifyOnIndexChange??!0?r(s):t=e.getLocation()},o=async({task:s,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){s();return}const u=e.getBlockers?.()??[],c=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&u.length&&c)for(const f of u){const h=Eg(l.path,l.state);if(await f.blockerFn({currentLocation:t,nextLocation:h,action:l.type})){e.onBlocked?.();return}}s()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:s=>(n.add(s),()=>{n.delete(s)}),push:(s,a,l)=>{const u=t.state[vs];a=RT(u+1,a),o({task:()=>{e.pushState(s,a),r({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:s,state:a})},replace:(s,a,l)=>{const u=t.state[vs];a=RT(u,a),o({task:()=>{e.replaceState(s,a),r({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:s,state:a})},go:(s,a)=>{o({task:()=>{e.go(s),i({type:"GO",index:s})},navigateOpts:a,type:"GO"})},back:s=>{o({task:()=>{e.back(s?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:s,type:"BACK"})},forward:s=>{o({task:()=>{e.forward(s?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:s,type:"FORWARD"})},canGoBack:()=>t.state[vs]!==0,createHref:s=>e.createHref(s),block:s=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,s]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(u=>u!==s))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function RT(e,t){t||(t={});const n=TC();return{...t,key:n,__TSR_key:n,[vs]:e}}function T7(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const o=()=>i,s=A=>i=A,a=A=>A,l=()=>Eg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state);if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=TC();t.history.replaceState({[vs]:0,key:A,__TSR_key:A},"")}let u=l(),c,f=!1,h=!1,d=!1,p=!1;const m=()=>u;let y,g;const v=()=>{y&&(O._ignoreSubscribers=!0,(y.isPush?t.history.pushState:t.history.replaceState)(y.state,"",y.href),O._ignoreSubscribers=!1,y=void 0,g=void 0,c=void 0)},x=(A,P,M)=>{const _=a(P);g||(c=u),u=Eg(P,M),y={href:_,state:M,isPush:y?.isPush||A==="push"},g||(g=Promise.resolve().then(()=>v()))},k=A=>{u=l(),O.notify({type:A})},w=async()=>{if(h){h=!1;return}const A=l(),P=A.state[vs]-u.state[vs],M=P===1,_=P===-1,E=!M&&!_||f;f=!1;const R=E?"GO":_?"BACK":"FORWARD",N=E?{type:"GO",index:P}:{type:_?"BACK":"FORWARD"};if(d)d=!1;else{const j=o();if(typeof document<"u"&&j.length){for(const B of j)if(await B.blockerFn({currentLocation:u,nextLocation:A,action:R})){h=!0,t.history.go(1),O.notify(N);return}}}u=l(),O.notify(N)},S=A=>{if(p){p=!1;return}let P=!1;const M=o();if(typeof document<"u"&&M.length)for(const _ of M){const E=_.enableBeforeUnload??!0;if(E===!0){P=!0;break}if(typeof E=="function"&&E()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},O=E7({getLocation:m,getLength:()=>t.history.length,pushState:(A,P)=>x("push",A,P),replaceState:(A,P)=>x("replace",A,P),back:A=>(A&&(d=!0),p=!0,t.history.back()),forward:A=>{A&&(d=!0),p=!0,t.history.forward()},go:A=>{f=!0,t.history.go(A)},createHref:A=>a(A),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(jT,S,{capture:!0}),t.removeEventListener(IT,w)},onBlocked:()=>{c&&u!==c&&(u=c)},getBlockers:o,setBlockers:s,notifyOnIndexChange:!1});return t.addEventListener(jT,S,{capture:!0}),t.addEventListener(IT,w),t.history.pushState=function(...A){const P=n.apply(t.history,A);return O._ignoreSubscribers||k("PUSH"),P},t.history.replaceState=function(...A){const P=r.apply(t.history,A);return O._ignoreSubscribers||k("REPLACE"),P},O}function _7(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Eg(e,t){const n=_7(e),r=n.indexOf("#"),i=n.indexOf("?"),o=TC();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[vs]:0,key:o,__TSR_key:o}}}function TC(){return(Math.random()+1).toString(36).substring(7)}function cu(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var M7=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{const r=this.options,i=this.basepath??r?.basepath??"/",o=this.basepath===void 0,s=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=o7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=T7()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let c;this.resolvePathCache=Mh(1e3),c=this.buildRouteTree(),this.setRoutes(c)}if(!this.stores&&this.latestLocation){const c=this.getStoreConfig(this);this.batch=c.batch,this.stores=w7(j7(this.latestLocation),c),f7(this)}let a=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(o||i!==l||s!==u){this.basepath=l;const c=[],f=F$(l);f&&f!=="/"&&c.push(x7({basepath:l})),u&&c.push(u),this.rewrite=c.length===0?void 0:c.length===1?c[0]:b7(c),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=JV(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&GV(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:l,search:u,hash:c,href:f,state:h})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(l)){const g=this.options.parseSearch(u),v=this.options.stringifySearch(g);return{href:l+v+c,publicHref:l+v+c,pathname:Zc(l).path,external:!1,searchStr:v,search:Qs(r?.search,g),hash:Zc(c.slice(1)).path,state:rs(r?.state,h)}}const d=new URL(f,this.origin),p=Ow(this.rewrite,d),m=this.options.parseSearch(p.search),y=this.options.stringifySearch(m);return p.search=y,{href:p.href.replace(p.origin,""),publicHref:f,pathname:Zc(p.pathname).path,external:!!this.rewrite&&p.origin!==this.origin,searchStr:y,search:Qs(r?.search,m),hash:Zc(p.hash.slice(1)).path,state:rs(r?.state,h)}},o=i(n),{__tempLocation:s,__tempKey:a}=o.state;if(s&&(!a||a===this.tempLocationKey)){const l=i(s);return l.state.key=o.state.key,l.state.__TSR_key=o.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>i7({base:n,to:EC(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>R7({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(o={})=>{const s=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(s);o.from;const l=o.unsafeRelative==="path"?s.pathname:o.from??a.fullPath,u=this.resolvePathWithBase(l,"."),c=a.search,f=Object.assign(Object.create(null),a.params),h=o.to?this.resolvePathWithBase(u,`${o.to}`):this.resolvePathWithBase(u,"."),d=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?f:Object.assign(f,ns(o.params,f)),p=this.getMatchedRoutes(h);let m=p.matchedRoutes;if((!p.foundRoute||p.foundRoute.path!=="/"&&p.routeParams["**"])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(d).length>0)for(const M of m){const _=M.options.params?.stringify??M.options.stringifyParams;if(_)try{Object.assign(d,_(d))}catch{}}const y=n.leaveParams?h:Zc(kT({path:h,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let g=c;if(n._includeValidateSearch&&this.options.search?.strict){const M={};m.forEach(_=>{if(_.options.validateSearch)try{Object.assign(M,$m(_.options.validateSearch,{...M,...g}))}catch{}}),g=M}g=N7({search:g,dest:o,destRoutes:m,_includeValidateSearch:n._includeValidateSearch}),g=Qs(c,g);const v=this.options.stringifySearch(g),x=o.hash===!0?s.hash:o.hash?ns(o.hash,s.hash):void 0,k=x?`#${x}`:"";let w=o.state===!0?s.state:o.state?ns(o.state,s.state):{};w=rs(s.state,w);const S=`${y}${v}${k}`;let O,A,P=!1;if(this.rewrite){const M=new URL(S,this.origin),_=z$(this.rewrite,M);O=M.href.replace(M.origin,""),_.origin!==this.origin?(A=_.href,P=!0):A=_.pathname+_.search+_.hash}else O=VV(S),A=O;return{publicHref:A,href:O,pathname:y,search:g,searchStr:v,state:w,hash:x??"",external:P,unmaskOnReload:o.unmaskOnReload}},i=(o={},s)=>{const a=r(o);let l=s?r(s):void 0;if(!l){const u=Object.create(null);if(this.options.routeMasks){const c=QV(a.pathname,this.processedTree);if(c){Object.assign(u,c.rawParams);const{from:f,params:h,...d}=c.route,p=h===!1||h===null?Object.create(null):(h??!0)===!0?u:Object.assign(u,ns(h,u));s={from:n.from,...d,params:p},l=r(s)}}}return l&&(a.maskedLocation=l),a};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{const o=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(c=>{i.state[c]=this.latestLocation.state[c]});const u=Pa(i.state,this.latestLocation.state);return l.forEach(c=>{delete i.state[c]}),u},s=ys(this.latestLocation.href)===ys(i.href);let a=this.commitLocationPromise;if(this.commitLocationPromise=ju(()=>{a?.resolve(),a=void 0}),s&&o())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,...c}=i;l&&(c={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...c,search:c.searchStr,state:{...c.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c.unmaskOnReload??this.options.unmaskOnReload??!1)&&(c.state.__tempKey=this.tempLocationKey)),c.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](c.publicHref,c.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:o,ignoreBlocker:s,href:a,...l}={})=>{if(a){const f=this.history.location.state.__TSR_index,h=Eg(a,{__TSR_index:n?f:f+1}),d=new URL(h.pathname,this.origin);l.to=Ow(this.rewrite,d).pathname,l.search=this.options.parseSearch(h.search),l.hash=h.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const c=this.commitLocation({...u,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:s});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:o,...s})=>{let a=!1;if(i)try{new URL(`${i}`),a=!0}catch{}if(a&&!r&&(r=!0),r){if(n!==void 0||!i){const u=this.buildLocation({to:n,...s});i=i??u.publicHref,o=o??u.publicHref}const l=!a&&o?o:i;if(Ag(l,this.protocolAllowlist))return Promise.resolve();if(!s.ignoreBlocker){const u=this.history.getBlockers?.()??[];for(const c of u)if(c?.blockerFn&&await c.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return s.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...s,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!n.some(o=>o.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{let r,i,o;const s=this.stores.resolvedLocation.get()??this.stores.location.get();for(o=new Promise(l=>{this.startTransition(async()=>{try{this.beforeLoad();const u=this.latestLocation,c=cu(u,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...c}),this.emit({type:"onBeforeLoad",...c}),await _T({router:this,sync:n?.sync,forceStaleReload:s.href===u.href,matches:this.stores.pendingMatches.get(),location:u,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let f=null,h=null,d=null,p=null;this.batch(()=>{const m=this.stores.pendingMatches.get(),y=m.length,g=this.stores.matches.get();f=y?g.filter(k=>!this.stores.pendingMatchStores.has(k.id)):null;const v=new Set;for(const k of this.stores.pendingMatchStores.values())k.routeId&&v.add(k.routeId);const x=new Set;for(const k of this.stores.matchStores.values())k.routeId&&x.add(k.routeId);h=y?g.filter(k=>!v.has(k.routeId)):null,d=y?m.filter(k=>!x.has(k.routeId)):null,p=y?m.filter(k=>x.has(k.routeId)):g,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),y&&(this.stores.setMatches(m),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...f.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]),this.clearExpiredCache())});for(const[m,y]of[[h,"onLeave"],[d,"onEnter"],[p,"onStay"]])if(m)for(const g of m)this.looseRoutesById[g.routeId].options[y]?.(g)})})}})}catch(u){Hn(u)?(r=u,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):vn(u)&&(i=u);const c=r?r.status:i?404:this.stores.matches.get().some(f=>f.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(c),this.stores.redirect.set(r)})}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(l=>l.status==="error")&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,s=this.stores.resolvedLocation.get(),a=typeof r.types=="function"?r.types(cu(o,s)):r.types;if(a===!1){n();return}i={update:n,types:a}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(r);return}const o=this.stores.matchStores.get(n);if(o){o.set(r);return}const s=this.stores.cachedMatchStores.get(n);if(s){const a=r(s.get());a.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(l=>l.filter(u=>u!==n)):s.set(a)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),o=this.getParsedLocationHref(i);n.options.href=o,n.headers.set("Location",o)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const o=i.pathname+i.search+i.hash;n.options.href=o,n.headers.set("Location",o)}}catch{}if(n.options.href&&!n.options._builtLocation&&Ag(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=i=>{const o=this.looseRoutesById[i.routeId];if(!o.options.loader)return!0;const s=(i.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=s};this.clearCache({filter:r})},this.loadRouteChunk=Ih,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),s=new Set([...o,...this.stores.cachedIds.get()]),a=i.filter(l=>!s.has(l.id));if(a.length){const l=this.stores.cachedMatches.get();this.stores.setCached([...l,...a])}try{return i=await _T({router:this,matches:i,location:r,preload:!0,updateMatch:(l,u)=>{o.has(l)?i=i.map(c=>c.id===l?u(c):c):this.updateMatch(l,u)}}),i}catch(l){if(Hn(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});vn(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(i);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const s=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=XV(o.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,s.pathname,this.processedTree);return!a||n.params&&!Pa(a.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Pa(s.search,o.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??m7,parseSearch:e.parseSearch??p7,protocolAllowlist:e.protocolAllowlist??HV}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:o}=n;let{matchedRoutes:s}=n,a=!1;(r?r.path!=="/"&&i["**"]:ys(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:a=!0);const l=a?L7(this.options.notFoundMode,s):void 0,u=new Array(s.length),c=new Map;for(const f of this.stores.matchStores.values())f.routeId&&c.set(f.routeId,f.get());for(let f=0;f<s.length;f++){const h=s[f],d=u[f-1];let p,m,y;{const R=d?.search??e.search,N=d?._strictSearch??void 0;try{const j=$m(h.options.validateSearch,{...R})??void 0;p={...R,...j},m={...N,...j},y=void 0}catch(j){let B=j;if(j instanceof Tg||(B=new Tg(j.message,{cause:j})),t?.throwOnError)throw B;p=R,m={},y=B}}const g=h.options.loaderDeps?.({search:p})??"",v=g?JSON.stringify(g):"",{interpolatedPath:x,usedParams:k}=kT({path:h.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),w=h.id+x+v,S=this.getMatch(w),O=c.get(h.id),A=S?._strictParams??k;let P;if(!S)try{NT(h,k,o,A)}catch(R){if(vn(R)||Hn(R)?P=R:P=new I7(R.message,{cause:R}),t?.throwOnError)throw P}Object.assign(i,A);const M=O?"stay":"enter";let _;if(S)_={...S,cause:M,params:O?.params??i,_strictParams:A,search:Qs(O?O.search:S.search,p),_strictSearch:m};else{const R=h.options.loader||h.options.beforeLoad||h.lazyFn||V$(h)?"pending":"success";_={id:w,ssr:h.options.ssr,index:f,routeId:h.id,params:O?.params??i,_strictParams:A,pathname:x,updatedAt:Date.now(),search:O?Qs(O.search,p):p,_strictSearch:m,searchError:void 0,status:R,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:ju()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:O?rs(O.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}t?.preload||(_.globalNotFound=l===h.id),_.searchError=y;const E=this.getParentContext(d);_.context={...E,..._.__routeContext,..._.__beforeLoadContext},u[f]=_}for(let f=0;f<u.length;f++){const h=u[f],d=this.looseRoutesById[h.routeId],p=this.getMatch(h.id),m=c.get(h.routeId);if(h.params=m?Qs(m.params,i):i,!p){const y=u[f-1],g=this.getParentContext(y);if(d.options.context){const v={deps:h.loaderDeps,params:h.params,context:g??{},location:e,navigate:x=>this.navigate({...x,_fromLocation:e}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:u,routeId:d.id};h.__routeContext=d.options.context(v)??void 0}h.context={...g,...h.__routeContext,...h.__beforeLoadContext}}}return u}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Th(t),o={...e.search};for(const c of t)try{Object.assign(o,$m(c.options.validateSearch,o))}catch{}const s=Th(this.stores.matchesId.get()),a=s&&this.stores.matchStores.get(s)?.get(),l=a&&a.routeId===i.id&&a.pathname===e.pathname;let u;if(l)u=a.params;else{const c=Object.assign(Object.create(null),n);for(const f of t)try{NT(f,n,r??{},c)}catch{}u=c}return{matchedRoutes:t,fullPath:i.fullPath,search:o,params:u}}},Tg=class extends Error{},I7=class extends Error{};function j7(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function $m(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Tg("Async validation not supported");if(n.issues)throw new Tg(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function R7({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=ys(e);let o,s;const a=YV(i,n,!0);return a&&(o=a.route,Object.assign(r,a.rawParams),s=Object.assign(Object.create(null),a.parsedParams)),{matchedRoutes:a?.branch||[t.__root__],routeParams:r,foundRoute:o,parsedParams:s}}function N7({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return D7(n)(e,t,r??!1)}function D7(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const o=({search:s,next:a})=>{let l=s;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(l=i.options.preSearchFilters.reduce((c,f)=>f(c),s));const u=a(l);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((c,f)=>f(c),u):u};t.middlewares.push(o)}if(i.options.validateSearch){const o=({search:s,next:a})=>{const l=a(s);if(!t._includeValidateSearch)return l;try{return{...l,...$m(i.options.validateSearch,l)??void 0}}catch{return l}};t.middlewares.push(o)}}const n=({search:i})=>{const o=t.dest;return o.search?o.search===!0?i:ns(o.search,i):{}};t.middlewares.push(n);const r=(i,o,s)=>{if(i>=s.length)return o;const a=s[i];return a({search:o,next:u=>r(i+1,u,s)})};return function(o,s,a){return t.dest=s,t._includeValidateSearch=a,r(0,o,t.middlewares)}}function L7(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Ea}function NT(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const o in t)o in n&&(r[o]=n[o]);else{const o=i(r);Object.assign(r,o)}}var $7="Error preloading route! ☝️",q$=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ea:this.parentRoute||mo();let i=r?Ea:n?.path;i&&i!=="/"&&(i=B$(i));const o=n?.id||i;let s=r?Ea:Dm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,o]);i==="__root__"&&(i="/"),s!=="__root__"&&(s=Dm(["/",s]));const a=s==="__root__"?"/":Dm([this.parentRoute.fullPath,i]);this._path=i,this._id=s,this._fullPath=a,this._to=ys(a)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>v7({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},B7=class extends q${constructor(e){super(e)}};function F7(e){if(typeof document<"u"&&document.querySelector){const t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==""){const r=document.getElementById(t.hash);r&&r.scrollIntoView(n)}}}function _C(e){const t=e.errorComponent??MC;return b.jsx(z7,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?C.createElement(t,{error:n,reset:r}):e.children})}var z7=class extends C.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function MC({error:e}){const[t,n]=C.useState(!1);return b.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[b.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),b.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),b.jsx("div",{style:{height:".25rem"}}),t?b.jsx("div",{children:b.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?b.jsx("code",{children:e.message}):null})}):null]})}function W7({children:e,fallback:t=null}){return K$()?b.jsx(L.Fragment,{children:e}):b.jsx(L.Fragment,{children:t})}function K$(){return L.useSyncExternalStore(U7,()=>!0,()=>!1)}function U7(){return()=>{}}var G$=C.createContext(null);function Pr(e){return C.useContext(G$)}var $v=C.createContext(void 0),H7=C.createContext(void 0),dt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(dt||{});function V7({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:o,checkDirty:s,shallowPropagate:a};function r(u,c,f){const h=c.depsTail;if(h!==void 0&&h.dep===u)return;const d=h!==void 0?h.nextDep:c.deps;if(d!==void 0&&d.dep===u){d.version=f,c.depsTail=d;return}const p=u.subsTail;if(p!==void 0&&p.version===f&&p.sub===c)return;const m=c.depsTail=u.subsTail={version:f,dep:u,sub:c,prevDep:h,nextDep:d,prevSub:p,nextSub:void 0};d!==void 0&&(d.prevDep=m),h!==void 0?h.nextDep=m:c.deps=m,p!==void 0?p.nextSub=m:u.subs=m}function i(u,c=u.sub){const f=u.dep,h=u.prevDep,d=u.nextDep,p=u.nextSub,m=u.prevSub;return d!==void 0?d.prevDep=h:c.depsTail=h,h!==void 0?h.nextDep=d:c.deps=d,p!==void 0?p.prevSub=m:f.subsTail=m,m!==void 0?m.nextSub=p:(f.subs=p)===void 0&&n(f),d}function o(u){let c=u.nextSub,f;e:do{const h=u.sub;let d=h.flags;if(d&60?d&12?d&4?!(d&48)&&l(u,h)?(h.flags=d|40,d&=1):d=0:h.flags=d&-9|32:d=0:h.flags=d|32,d&2&&t(h),d&1){const p=h.subs;if(p!==void 0){const m=(u=p).nextSub;m!==void 0&&(f={value:c,prev:f},c=m);continue}}if((u=c)!==void 0){c=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){c=u.nextSub;continue e}break}while(!0)}function s(u,c){let f,h=0,d=!1;e:do{const p=u.dep,m=p.flags;if(c.flags&16)d=!0;else if((m&17)===17){if(e(p)){const y=p.subs;y.nextSub!==void 0&&a(y),d=!0}}else if((m&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=p.deps,c=p,++h;continue}if(!d){const y=u.nextDep;if(y!==void 0){u=y;continue}}for(;h--;){const y=c.subs,g=y.nextSub!==void 0;if(g?(u=f.value,f=f.prev):u=y,d){if(e(c)){g&&a(y),c=u.sub;continue}d=!1}else c.flags&=-33;c=u.sub;const v=u.nextDep;if(v!==void 0){u=v;continue e}}return d}while(!0)}function a(u){do{const c=u.sub,f=c.flags;(f&48)===32&&(c.flags=f|16,(f&6)===2&&t(c))}while((u=u.nextSub)!==void 0)}function l(u,c){let f=c.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}function q7(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const Aw=[];let Bm=0;const{link:DT,unlink:K7,propagate:G7,checkDirty:Q$,shallowPropagate:LT}=V7({update(e){return e._update()},notify(e){Aw[Pw++]=e,e.flags&=~dt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=dt.Mutable|dt.Dirty,_g(e))}});let _p=0,Pw=0,Pi,Ew=0;function X$(e){try{++Ew,e()}finally{--Ew||Y$()}}function _g(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=K7(n,e)}function Y$(){if(!(Ew>0)){for(;_p<Pw;){const e=Aw[_p];Aw[_p++]=void 0,e.notify()}_p=0,Pw=0}}function $T(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?dt.None:dt.Mutable,get(){return Pi!==void 0&&DT(i,Pi,Bm),i._snapshot},subscribe(o){const s=q7(o),a={current:!1},l=Q7(()=>{i.get(),a.current?s.next?.(i._snapshot):a.current=!0});return{unsubscribe:()=>{l.stop()}}},_update(o){const s=Pi,a=t?.compare??Object.is;if(n)Pi=i,++Bm,i.depsTail=void 0;else if(o===void 0)return!1;n&&(i.flags=dt.Mutable|dt.RecursedCheck);try{const l=i._snapshot,u=typeof o=="function"?o(l):o===void 0&&n?r(l):o;return l===void 0||!a(l,u)?(i._snapshot=u,!0):!1}finally{Pi=s,n&&(i.flags&=~dt.RecursedCheck),_g(i)}}};return n?(i.flags=dt.Mutable|dt.Dirty,i.get=function(){const o=i.flags;if(o&dt.Dirty||o&dt.Pending&&Q$(i.deps,i)){if(i._update()){const s=i.subs;s!==void 0&&LT(s)}}else o&dt.Pending&&(i.flags=o&~dt.Pending);return Pi!==void 0&&DT(i,Pi,Bm),i._snapshot}):i.set=function(o){if(i._update(o)){const s=i.subs;s!==void 0&&(G7(s),LT(s),Y$())}},i}function Q7(e){const t=()=>{const r=Pi;Pi=n,++Bm,n.depsTail=void 0,n.flags=dt.Watching|dt.RecursedCheck;try{return e()}finally{Pi=r,n.flags&=~dt.RecursedCheck,_g(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:dt.Watching|dt.RecursedCheck,notify(){const r=this.flags;r&dt.Dirty||r&dt.Pending&&Q$(this.deps,this)?t():this.flags=dt.Watching},stop(){this.flags=dt.None,this.depsTail=void 0,_g(this)}};return t(),n}var Z$={exports:{}},J$={},eB={exports:{}},tB={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var Ru=C;function X7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Y7=typeof Object.is=="function"?Object.is:X7,Z7=Ru.useState,J7=Ru.useEffect,eq=Ru.useLayoutEffect,tq=Ru.useDebugValue;function nq(e,t){var n=t(),r=Z7({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return eq(function(){i.value=n,i.getSnapshot=t,Ub(i)&&o({inst:i})},[e,n,t]),J7(function(){return Ub(i)&&o({inst:i}),e(function(){Ub(i)&&o({inst:i})})},[e]),tq(n),n}function Ub(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Y7(e,n)}catch{return!0}}function rq(e,t){return t()}var iq=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rq:nq;tB.useSyncExternalStore=Ru.useSyncExternalStore!==void 0?Ru.useSyncExternalStore:iq;eB.exports=tB;var oq=eB.exports;/**
49
+ * @license React
50
+ * use-sync-external-store-shim/with-selector.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var Bv=C,sq=oq;function aq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lq=typeof Object.is=="function"?Object.is:aq,uq=sq.useSyncExternalStore,cq=Bv.useRef,fq=Bv.useEffect,hq=Bv.useMemo,dq=Bv.useDebugValue;J$.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=cq(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=hq(function(){function l(d){if(!u){if(u=!0,c=d,d=r(d),i!==void 0&&s.hasValue){var p=s.value;if(i(p,d))return f=p}return f=d}if(p=f,lq(c,d))return p;var m=r(d);return i!==void 0&&i(p,m)?(c=d,p):(c=d,f=m)}var u=!1,c,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,i]);var a=uq(e,o[0],o[1]);return fq(function(){s.hasValue=!0,s.value=a},[a]),dq(a),a};Z$.exports=J$;var pq=Z$.exports;function mq(e,t){return e===t}function Jn(e,t,n=mq){const r=C.useCallback(s=>{if(!e)return()=>{};const{unsubscribe:a}=e.subscribe(s);return a},[e]),i=C.useCallback(()=>e?.get(),[e]);return pq.useSyncExternalStoreWithSelector(r,i,i,t,n)}var gq={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function rl(e){const t=Pr(),n=C.useContext(e.from?H7:$v),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,o=C.useRef(void 0);return Jn(i??gq,s=>{if((e.shouldThrow??!0)&&!s&&mo(),s===void 0)return;const a=e.select?e.select(s):s;if(e.structuralSharing??t.options.defaultStructuralSharing){const l=rs(o.current,a);return o.current=l,l}return a})}function nB(e){return rl({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rB(e){const{select:t,...n}=e;return rl({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Hd(e){return rl({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Vd(e){return rl({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function mi(e){const t=Pr();return C.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function iB(e){return rl({...e,select:t=>e.select?e.select(t.context):t.context})}function yq(e,t){const n=Pr(),r=BV(t),{activeProps:i,inactiveProps:o,activeOptions:s,to:a,preload:l,preloadDelay:u,preloadIntentProximity:c,hashScrollIntoView:f,replace:h,startTransition:d,resetScroll:p,viewTransition:m,children:y,target:g,disabled:v,style:x,className:k,onClick:w,onBlur:S,onFocus:O,onMouseEnter:A,onMouseLeave:P,onTouchStart:M,ignoreBlocker:_,params:E,search:R,hash:N,state:j,mask:B,reloadDocument:F,unsafeRelative:$,from:z,_fromLocation:T,...q}=e,D=K$(),I=C.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),Y=Jn(n.stores.location,$e=>$e,($e,U)=>$e.href===U.href),G=C.useMemo(()=>{const $e={_fromLocation:Y,...I};return n.buildLocation($e)},[n,Y,I]),te=G.maskedLocation?G.maskedLocation.publicHref:G.publicHref,fe=G.maskedLocation?G.maskedLocation.external:G.external,ye=C.useMemo(()=>kq(te,fe,n.history,v),[v,fe,te,n.history]),Q=C.useMemo(()=>{if(ye?.external)return Ag(ye.href,n.protocolAllowlist)?void 0:ye.href;if(!Oq(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Ag(a,n.protocolAllowlist)?void 0:a}catch{}},[a,ye,n.protocolAllowlist]),ue=C.useMemo(()=>{if(Q)return!1;if(s?.exact){if(!r7(Y.pathname,G.pathname,n.basepath))return!1}else{const $e=Pg(Y.pathname,n.basepath),U=Pg(G.pathname,n.basepath);if(!($e.startsWith(U)&&($e.length===U.length||$e[U.length]==="/")))return!1}return(s?.includeSearch??!0)&&!Pa(Y.search,G.search,{partial:!s?.exact,ignoreUndefined:!s?.explicitUndefined})?!1:s?.includeHash?D&&Y.hash===G.hash:!0},[s?.exact,s?.explicitUndefined,s?.includeHash,s?.includeSearch,Y,Q,D,G.hash,G.pathname,G.search,n.basepath]),me=ue?ns(i,{})??vq:Hb,X=ue?Hb:ns(o,{})??Hb,qe=[k,me.className,X.className].filter(Boolean).join(" "),Ce=(x||me.style||X.style)&&{...x,...me.style,...X.style},[ht,st]=C.useState(!1),_t=C.useRef(!1),tn=e.reloadDocument||Q?!1:l??n.options.defaultPreload,ir=u??n.options.defaultPreloadDelay??0,Cn=C.useCallback(()=>{n.preloadRoute({...I,_builtLocation:G}).catch($e=>{console.warn($e),console.warn($7)})},[n,I,G]);$V(r,C.useCallback($e=>{$e?.isIntersecting&&Cn()},[Cn]),Sq,{disabled:!!v||tn!=="viewport"}),C.useEffect(()=>{_t.current||!v&&tn==="render"&&(Cn(),_t.current=!0)},[v,Cn,tn]);const Yr=$e=>{const U=$e.currentTarget.getAttribute("target"),ee=g!==void 0?g:U;if(!v&&!Cq($e)&&!$e.defaultPrevented&&(!ee||ee==="_self")&&$e.button===0){$e.preventDefault(),nl.flushSync(()=>{st(!0)});const ve=n.subscribe("onResolved",()=>{ve(),st(!1)});n.navigate({...I,replace:h,resetScroll:p,hashScrollIntoView:f,startTransition:d,viewTransition:m,ignoreBlocker:_})}};if(Q)return{...q,ref:r,href:Q,...y&&{children:y},...g&&{target:g},...v&&{disabled:v},...x&&{style:x},...k&&{className:k},...w&&{onClick:w},...S&&{onBlur:S},...O&&{onFocus:O},...A&&{onMouseEnter:A},...P&&{onMouseLeave:P},...M&&{onTouchStart:M}};const Er=$e=>{if(v||tn!=="intent")return;if(!ir){Cn();return}const U=$e.currentTarget;if(nf.has(U))return;const ee=setTimeout(()=>{nf.delete(U),Cn()},ir);nf.set(U,ee)},qs=$e=>{v||tn!=="intent"||Cn()},Ks=$e=>{if(v||!tn||!ir)return;const U=$e.currentTarget,ee=nf.get(U);ee&&(clearTimeout(ee),nf.delete(U))};return{...q,...me,...X,href:ye?.href,ref:r,onClick:yl([w,Yr]),onBlur:yl([S,Ks]),onFocus:yl([O,Er]),onMouseEnter:yl([A,Er]),onMouseLeave:yl([P,Ks]),onTouchStart:yl([M,qs]),disabled:!!v,target:g,...Ce&&{style:Ce},...qe&&{className:qe},...v&&bq,...ue&&xq,...D&&ht&&wq}}var Hb={},vq={className:"active"},bq={role:"link","aria-disabled":!0},xq={"data-status":"active","aria-current":"page"},wq={"data-transitioning":"transitioning"},nf=new WeakMap,Sq={rootMargin:"100px"},yl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function kq(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Oq(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var ln=C.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...o}=yq(r,t),s=typeof r.children=="function"?r.children({isActive:o["data-status"]==="active"}):r.children;if(!n){const{disabled:a,...l}=o;return C.createElement("a",l,s)}return C.createElement(n,o,s)});function Cq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Aq=class extends q${constructor(e){super(e),this.useMatch=t=>rl({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>iB({...t,from:this.id}),this.useSearch=t=>Vd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Hd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>rB({...t,from:this.id}),this.useLoaderData=t=>nB({...t,from:this.id}),this.useNavigate=()=>mi({from:this.fullPath}),this.Link=L.forwardRef((t,n)=>b.jsx(ln,{ref:n,from:this.fullPath,...t}))}};function wc(e){return new Aq(e)}var Pq=class extends B7{constructor(e){super(e),this.useMatch=t=>rl({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>iB({...t,from:this.id}),this.useSearch=t=>Vd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Hd({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>rB({...t,from:this.id}),this.useLoaderData=t=>nB({...t,from:this.id}),this.useNavigate=()=>mi({from:this.fullPath}),this.Link=L.forwardRef((t,n)=>b.jsx(ln,{ref:n,from:this.fullPath,...t}))}};function Eq(e){return new Pq(e)}function Tq(e){const t=Pr(),n=`not-found-${Jn(t.stores.location,r=>r.pathname)}-${Jn(t.stores.status,r=>r)}`;return b.jsx(_C,{getResetKey:()=>n,onCatch:(r,i)=>{if(vn(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(vn(r))return e.fallback?.(r);throw r},children:e.children})}function _q(){return b.jsx("p",{children:"Not Found"})}function Al(e){return b.jsx(b.Fragment,{children:e.children})}function oB(e,t,n){return t.options.notFoundComponent?b.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?b.jsx(e.options.defaultNotFoundComponent,{...n}):b.jsx(_q,{})}function Mq(e){return null}function Iq(){return Mq(Pr()),null}var sB=C.memo(function({matchId:t}){const n=Pr(),r=n.stores.matchStores.get(t);r||mo();const i=Jn(n.stores.loadedAt,s=>s),o=Jn(r,s=>s);return b.jsx(jq,{router:n,matchId:t,resetKey:i,matchState:C.useMemo(()=>{const s=o.routeId,a=n.routesById[s].parentRoute?.id;return{routeId:s,ssr:o.ssr,_displayPending:o._displayPending,parentRouteId:a}},[o._displayPending,o.routeId,o.ssr,n.routesById])})});function jq({router:e,matchId:t,resetKey:n,matchState:r}){const i=e.routesById[r.routeId],o=i.options.pendingComponent??e.options.defaultPendingComponent,s=o?b.jsx(o,{}):null,a=i.options.errorComponent??e.options.defaultErrorComponent,l=i.options.onCatch??e.options.defaultOnCatch,u=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,c=r.ssr===!1||r.ssr==="data-only",f=(!i.isRoot||i.options.wrapInSuspense||c)&&(i.options.wrapInSuspense??o??(i.options.errorComponent?.preload||c))?C.Suspense:Al,h=a?_C:Al,d=u?Tq:Al;return b.jsxs(i.isRoot?i.options.shellComponent??Al:Al,{children:[b.jsx($v.Provider,{value:t,children:b.jsx(f,{fallback:s,children:b.jsx(h,{getResetKey:()=>n,errorComponent:a||MC,onCatch:(p,m)=>{if(vn(p))throw p.routeId??=r.routeId,p;l?.(p,m)},children:b.jsx(d,{fallback:p=>{if(p.routeId??=r.routeId,!u||p.routeId&&p.routeId!==r.routeId||!p.routeId&&!i.isRoot)throw p;return C.createElement(u,p)},children:c||r._displayPending?b.jsx(W7,{fallback:s,children:b.jsx(BT,{matchId:t})}):b.jsx(BT,{matchId:t})})})})}),r.parentRouteId===Ea?b.jsxs(b.Fragment,{children:[b.jsx(Rq,{resetKey:n}),e.options.scrollRestoration&&D$?b.jsx(Iq,{}):null]}):null]})}function Rq({resetKey:e}){const t=Pr(),n=C.useRef(void 0);return Tf(()=>{const r=t.latestLocation.href;(n.current===void 0||n.current!==r)&&(t.emit({type:"onRendered",...cu(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=r)},[t.latestLocation.state.__TSR_key,e,t]),null}var BT=C.memo(function({matchId:t}){const n=Pr(),r=(c,f)=>n.getMatch(c.id)?._nonReactive[f]??c._nonReactive[f],i=n.stores.matchStores.get(t);i||mo();const o=Jn(i,c=>c),s=o.routeId,a=n.routesById[s],l=C.useMemo(()=>{const c=(n.routesById[s].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:s,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return c?JSON.stringify(c):void 0},[s,o.loaderDeps,o._strictParams,o._strictSearch,n.options.defaultRemountDeps,n.routesById]),u=C.useMemo(()=>{const c=a.options.component??n.options.defaultComponent;return c?b.jsx(c,{},l):b.jsx(aB,{})},[l,a.options.component,n.options.defaultComponent]);if(o._displayPending)throw r(o,"displayPendingPromise");if(o._forcePending)throw r(o,"minPendingPromise");if(o.status==="pending"){const c=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(c){const f=n.getMatch(o.id);if(f&&!f._nonReactive.minPendingPromise){const h=ju();f._nonReactive.minPendingPromise=h,setTimeout(()=>{h.resolve(),f._nonReactive.minPendingPromise=void 0},c)}}throw r(o,"loadPromise")}if(o.status==="notFound")return vn(o.error)||mo(),oB(n,a,o.error);if(o.status==="redirected")throw Hn(o.error)||mo(),r(o,"loadPromise");if(o.status==="error")throw o.error;return u}),aB=C.memo(function(){const t=Pr(),n=C.useContext($v);let r,i=!1,o;{const u=n?t.stores.matchStores.get(n):void 0;[r,i]=Jn(u,c=>[c?.routeId,c?.globalNotFound??!1]),o=Jn(t.stores.matchesId,c=>c[c.findIndex(f=>f===n)+1])}const s=r?t.routesById[r]:void 0,a=t.options.defaultPendingComponent?b.jsx(t.options.defaultPendingComponent,{}):null;if(i)return s||mo(),oB(t,s,void 0);if(!o)return null;const l=b.jsx(sB,{matchId:o});return r===Ea?b.jsx(C.Suspense,{fallback:a,children:l}):l});function Nq(){const e=Pr(),t=C.useRef({router:e,mounted:!1}),[n,r]=C.useState(!1),i=Jn(e.stores.isLoading,f=>f),o=Jn(e.stores.hasPending,f=>f),s=Nb(i),a=i||n||o,l=Nb(a),u=i||o,c=Nb(u);return e.startTransition=f=>{r(!0),C.startTransition(()=>{f(),r(!1)})},C.useEffect(()=>{const f=e.history.subscribe(e.load),h=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ys(e.latestLocation.publicHref)!==ys(h.publicHref)&&e.commitLocation({...h,replace:!0}),()=>{f()}},[e,e.history]),Tf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(h){console.error(h)}})()},[e]),Tf(()=>{s&&!i&&e.emit({type:"onLoad",...cu(e.stores.location.get(),e.stores.resolvedLocation.get())})},[s,e,i]),Tf(()=>{c&&!u&&e.emit({type:"onBeforeRouteMount",...cu(e.stores.location.get(),e.stores.resolvedLocation.get())})},[u,c,e]),Tf(()=>{if(l&&!a){const f=cu(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...f}),X$(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),f.hrefChanged&&F7(e)}},[a,l,e]),null}function Dq(){const e=Pr(),t=e.routesById[Ea].options.pendingComponent??e.options.defaultPendingComponent,n=t?b.jsx(t,{}):null,r=b.jsxs(typeof document<"u"&&e.ssr?Al:C.Suspense,{fallback:n,children:[b.jsx(Nq,{}),b.jsx(Lq,{})]});return e.options.InnerWrap?b.jsx(e.options.InnerWrap,{children:r}):r}function Lq(){const e=Pr(),t=Jn(e.stores.firstId,i=>i),n=Jn(e.stores.loadedAt,i=>i),r=t?b.jsx(sB,{matchId:t}):null;return b.jsx($v.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:b.jsx(_C,{getResetKey:()=>n,errorComponent:MC,onCatch:void 0,children:r})})}function $q(e){const t=Pr(),n=C.useRef(void 0);return Jn(t.stores.matches,r=>{const i=r;if(t.options.defaultStructuralSharing){const o=rs(n.current,i);return n.current=o,o}return i})}var Bq=e=>({createMutableStore:$T,createReadonlyStore:$T,batch:X$}),Fq=e=>new zq(e),zq=class extends M7{constructor(e){super(e,Bq)}};function Wq({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=b.jsx(G$.Provider,{value:e,children:t});return e.options.Wrap?b.jsx(e.options.Wrap,{children:r}):r}function Uq({router:e,...t}){return b.jsx(Wq,{router:e,...t,children:b.jsx(Dq,{})})}const Tw="squad.console.token";function Hq(){const e=new URL(window.location.href),t=e.searchParams.get("t");return t?(sessionStorage.setItem(Tw,t),e.searchParams.delete("t"),window.history.replaceState({},"",e.toString()),t):sessionStorage.getItem(Tw)}class $r extends Error{constructor(){super("Session token missing or invalid. Reopen squad console."),this.name="UnauthorizedError"}}async function Be(e,t){const n=sessionStorage.getItem(Tw);if(!n)throw new $r;const r=await fetch(e,{...t,headers:{"content-type":"application/json",authorization:`Bearer ${n}`,...t?.headers??{}}});if(r.status===401)throw new $r;if(!r.ok){const i=await Vq(r);throw new Error(`${r.status} ${r.statusText}: ${i}`)}return await r.json()}async function Vq(e){try{return(await e.text()).slice(0,400)}catch{return""}}var FT=1,qq=.9,Kq=.8,Gq=.17,Vb=.1,qb=.999,Qq=.9999,Xq=.99,Yq=/[\\\/_+.#"@\[\(\{&]/,Zq=/[\\\/_+.#"@\[\(\{&]/g,Jq=/[\s-]/,lB=/[\s-]/g;function _w(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?FT:Xq;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(o),u=n.indexOf(l,i),c=0,f,h,d,p;u>=0;)f=_w(e,t,n,r,u+1,o+1,s),f>c&&(u===i?f*=FT:Yq.test(e.charAt(u-1))?(f*=Kq,d=e.slice(i,u-1).match(Zq),d&&i>0&&(f*=Math.pow(qb,d.length))):Jq.test(e.charAt(u-1))?(f*=qq,p=e.slice(i,u-1).match(lB),p&&i>0&&(f*=Math.pow(qb,p.length))):(f*=Gq,i>0&&(f*=Math.pow(qb,u-i))),e.charAt(u)!==t.charAt(o)&&(f*=Qq)),(f<Vb&&n.charAt(u-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(u-1)!==r.charAt(o))&&(h=_w(e,t,n,r,u+1,o+2,s),h*Vb>f&&(f=h*Vb)),f>c&&(c=f),u=n.indexOf(l,u+1);return s[a]=c,c}function zT(e){return e.toLowerCase().replace(lB," ")}function eK(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,_w(e,t,zT(e),zT(t),0,0,{})}function bs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function WT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cs(...e){return t=>{let n=!1;const r=e.map(i=>{const o=WT(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():WT(e[i],null)}}}}function il(...e){return C.useCallback(Cs(...e),e)}function tK(e,t){const n=C.createContext(t),r=o=>{const{children:s,...a}=o,l=C.useMemo(()=>a,Object.values(a));return b.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=C.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function nK(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s),l=n.length;n=[...n,s];const u=f=>{const{scope:h,children:d,...p}=f,m=h?.[e]?.[l]||a,y=C.useMemo(()=>p,Object.values(p));return b.jsx(m.Provider,{value:y,children:d})};u.displayName=o+"Provider";function c(f,h){const d=h?.[e]?.[l]||a,p=C.useContext(d);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[u,c]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=a?.[e]||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,rK(i,...t)]}function rK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(o)[`__scope${u}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var jh=globalThis?.document?C.useLayoutEffect:()=>{},iK=_O[" useId ".trim().toString()]||(()=>{}),oK=0;function go(e){const[t,n]=C.useState(iK());return jh(()=>{n(r=>r??String(oK++))},[e]),t?`radix-${t}`:""}var sK=_O[" useInsertionEffect ".trim().toString()]||jh;function aK({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=lK({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const c=C.useRef(e!==void 0);C.useEffect(()=>{const f=c.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,r])}const u=C.useCallback(c=>{if(a){const f=uK(c)?c(e):c;f!==e&&s.current?.(f)}else o(c)},[a,e,o,s]);return[l,u]}function lK({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return sK(()=>{o.current=t},[t]),C.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function uK(e){return typeof e=="function"}function uB(e){const t=cK(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(hK);if(l){const u=l.props.children,c=a.map(f=>f===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:f);return b.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,c):null})}return b.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function cK(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=pK(i),a=dK(o,i.props);return i.type!==C.Fragment&&(a.ref=r?Cs(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fK=Symbol("radix.slottable");function hK(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fK}function dK(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function pK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],No=mK.reduce((e,t)=>{const n=uB(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gK(e,t){e&&nl.flushSync(()=>e.dispatchEvent(t))}function Rh(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>t.current?.(...n),[])}function yK(e,t=globalThis?.document){const n=Rh(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var vK="DismissableLayer",Mw="dismissableLayer.update",bK="dismissableLayer.pointerDownOutside",xK="dismissableLayer.focusOutside",UT,cB=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fB=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(cB),[c,f]=C.useState(null),h=c?.ownerDocument??globalThis?.document,[,d]=C.useState({}),p=il(t,O=>f(O)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),v=c?m.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,k=v>=g,w=kK(O=>{const A=O.target,P=[...u.branches].some(M=>M.contains(A));!k||P||(i?.(O),s?.(O),O.defaultPrevented||a?.())},h),S=OK(O=>{const A=O.target;[...u.branches].some(M=>M.contains(A))||(o?.(O),s?.(O),O.defaultPrevented||a?.())},h);return yK(O=>{v===u.layers.size-1&&(r?.(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},h),C.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(UT=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),HT(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=UT)}},[c,h,n,u]),C.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),HT())},[c,u]),C.useEffect(()=>{const O=()=>d({});return document.addEventListener(Mw,O),()=>document.removeEventListener(Mw,O)},[]),b.jsx(No.div,{...l,ref:p,style:{pointerEvents:x?k?"auto":"none":void 0,...e.style},onFocusCapture:bs(e.onFocusCapture,S.onFocusCapture),onBlurCapture:bs(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:bs(e.onPointerDownCapture,w.onPointerDownCapture)})});fB.displayName=vK;var wK="DismissableLayerBranch",SK=C.forwardRef((e,t)=>{const n=C.useContext(cB),r=C.useRef(null),i=il(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),b.jsx(No.div,{...e,ref:i})});SK.displayName=wK;function kK(e,t=globalThis?.document){const n=Rh(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){hB(bK,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function OK(e,t=globalThis?.document){const n=Rh(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&hB(xK,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function HT(){const e=new CustomEvent(Mw);document.dispatchEvent(e)}function hB(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?gK(i,o):i.dispatchEvent(o)}var Kb="focusScope.autoFocusOnMount",Gb="focusScope.autoFocusOnUnmount",VT={bubbles:!1,cancelable:!0},CK="FocusScope",dB=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Rh(i),c=Rh(o),f=C.useRef(null),h=il(t,m=>l(m)),d=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(x){if(d.paused||!a)return;const k=x.target;a.contains(k)?f.current=k:Uo(f.current,{select:!0})},y=function(x){if(d.paused||!a)return;const k=x.relatedTarget;k!==null&&(a.contains(k)||Uo(f.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&Uo(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,d.paused]),C.useEffect(()=>{if(a){KT.add(d);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Kb,VT);a.addEventListener(Kb,u),a.dispatchEvent(g),g.defaultPrevented||(AK(MK(pB(a)),{select:!0}),document.activeElement===m&&Uo(a))}return()=>{a.removeEventListener(Kb,u),setTimeout(()=>{const g=new CustomEvent(Gb,VT);a.addEventListener(Gb,c),a.dispatchEvent(g),g.defaultPrevented||Uo(m??document.body,{select:!0}),a.removeEventListener(Gb,c),KT.remove(d)},0)}}},[a,u,c,d]);const p=C.useCallback(m=>{if(!n&&!r||d.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[x,k]=PK(v);x&&k?!m.shiftKey&&g===k?(m.preventDefault(),n&&Uo(x,{select:!0})):m.shiftKey&&g===x&&(m.preventDefault(),n&&Uo(k,{select:!0})):g===v&&m.preventDefault()}},[n,r,d.paused]);return b.jsx(No.div,{tabIndex:-1,...s,ref:h,onKeyDown:p})});dB.displayName=CK;function AK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Uo(r,{select:t}),document.activeElement!==n)return}function PK(e){const t=pB(e),n=qT(t,e),r=qT(t.reverse(),e);return[n,r]}function pB(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qT(e,t){for(const n of e)if(!EK(n,{upTo:t}))return n}function EK(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TK(e){return e instanceof HTMLInputElement&&"select"in e}function Uo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TK(e)&&t&&e.select()}}var KT=_K();function _K(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=GT(e,t),e.unshift(t)},remove(t){e=GT(e,t),e[0]?.resume()}}}function GT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function MK(e){return e.filter(t=>t.tagName!=="A")}var IK="Portal",mB=C.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=C.useState(!1);jh(()=>o(!0),[]);const s=n||i&&globalThis?.document?.body;return s?eV.createPortal(b.jsx(No.div,{...r,ref:t}),s):null});mB.displayName=IK;function jK(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Fv=e=>{const{present:t,children:n}=e,r=RK(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=il(r.ref,NK(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};Fv.displayName="Presence";function RK(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=jK(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=Mp(r.current);o.current=a==="mounted"?u:"none"},[a]),jh(()=>{const u=r.current,c=i.current;if(c!==e){const h=o.current,d=Mp(u);e?l("MOUNT"):d==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),jh(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,f=d=>{const m=Mp(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=d=>{d.target===t&&(o.current=Mp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Mp(e){return e?.animationName||"none"}function NK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qb=0;function DK(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??QT()),document.body.insertAdjacentElement("beforeend",e[1]??QT()),Qb++,()=>{Qb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qb--}},[])}function QT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ti=function(){return Ti=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ti.apply(this,arguments)};function gB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function LK(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Fm="right-scroll-bar-position",zm="width-before-scroll-bar",$K="with-scroll-bars-hidden",BK="--removed-body-scroll-bar-size";function Xb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function FK(e,t){var n=C.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var zK=typeof window<"u"?C.useLayoutEffect:C.useEffect,XT=new WeakMap;function WK(e,t){var n=FK(null,function(r){return e.forEach(function(i){return Xb(i,r)})});return zK(function(){var r=XT.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Xb(a,null)}),o.forEach(function(a){i.has(a)||Xb(a,s)})}XT.set(n,e)},[e]),n}function UK(e){return e}function HK(e,t){t===void 0&&(t=UK);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var c=s;s=[],c.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){s.push(c),u()},filter:function(c){return s=s.filter(c),n}}}};return i}function VK(e){e===void 0&&(e={});var t=HK(null);return t.options=Ti({async:!0,ssr:!1},e),t}var yB=function(e){var t=e.sideCar,n=gB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,Ti({},n))};yB.isSideCarExport=!0;function qK(e,t){return e.useMedium(t),yB}var vB=VK(),Yb=function(){},zv=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Yb,onWheelCapture:Yb,onTouchMoveCapture:Yb}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,h=e.sideCar,d=e.noRelative,p=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,x=e.gapMode,k=gB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,S=WK([n,t]),O=Ti(Ti({},k),i);return C.createElement(C.Fragment,null,c&&C.createElement(w,{sideCar:vB,removeScrollBar:u,shards:f,noRelative:d,noIsolation:p,inert:m,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?C.cloneElement(C.Children.only(a),Ti(Ti({},O),{ref:S})):C.createElement(v,Ti({},O,{className:l,ref:S}),a))});zv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zv.classNames={fullWidth:zm,zeroRight:Fm};var KK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GK(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KK();return t&&e.setAttribute("nonce",t),e}function QK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function XK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var YK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GK())&&(QK(t,n),XK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZK=function(){var e=YK();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bB=function(){var e=ZK(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},JK={left:0,top:0,right:0,gap:0},Zb=function(e){return parseInt(e||"",10)||0},eG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Zb(n),Zb(r),Zb(i)]},tG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JK;var t=eG(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},nG=bB(),fu="data-scroll-locked",rG=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
57
+ .`.concat($K,` {
58
+ overflow: hidden `).concat(r,`;
59
+ padding-right: `).concat(a,"px ").concat(r,`;
60
+ }
61
+ body[`).concat(fu,`] {
62
+ overflow: hidden `).concat(r,`;
63
+ overscroll-behavior: contain;
64
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
65
+ padding-left: `.concat(i,`px;
66
+ padding-top: `).concat(o,`px;
67
+ padding-right: `).concat(s,`px;
68
+ margin-left:0;
69
+ margin-top:0;
70
+ margin-right: `).concat(a,"px ").concat(r,`;
71
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
72
+ }
73
+
74
+ .`).concat(Fm,` {
75
+ right: `).concat(a,"px ").concat(r,`;
76
+ }
77
+
78
+ .`).concat(zm,` {
79
+ margin-right: `).concat(a,"px ").concat(r,`;
80
+ }
81
+
82
+ .`).concat(Fm," .").concat(Fm,` {
83
+ right: 0 `).concat(r,`;
84
+ }
85
+
86
+ .`).concat(zm," .").concat(zm,` {
87
+ margin-right: 0 `).concat(r,`;
88
+ }
89
+
90
+ body[`).concat(fu,`] {
91
+ `).concat(BK,": ").concat(a,`px;
92
+ }
93
+ `)},YT=function(){var e=parseInt(document.body.getAttribute(fu)||"0",10);return isFinite(e)?e:0},iG=function(){C.useEffect(function(){return document.body.setAttribute(fu,(YT()+1).toString()),function(){var e=YT()-1;e<=0?document.body.removeAttribute(fu):document.body.setAttribute(fu,e.toString())}},[])},oG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;iG();var o=C.useMemo(function(){return tG(i)},[i]);return C.createElement(nG,{styles:rG(o,!t,i,n?"":"!important")})},Iw=!1;if(typeof window<"u")try{var Ip=Object.defineProperty({},"passive",{get:function(){return Iw=!0,!0}});window.addEventListener("test",Ip,Ip),window.removeEventListener("test",Ip,Ip)}catch{Iw=!1}var vl=Iw?{passive:!1}:!1,sG=function(e){return e.tagName==="TEXTAREA"},xB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sG(e)&&n[t]==="visible")},aG=function(e){return xB(e,"overflowY")},lG=function(e){return xB(e,"overflowX")},ZT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=wB(e,r);if(i){var o=SB(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wB=function(e,t){return e==="v"?aG(t):lG(t)},SB=function(e,t){return e==="v"?uG(t):cG(t)},fG=function(e,t){return e==="h"&&t==="rtl"?-1:1},hG=function(e,t,n,r,i){var o=fG(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,c=s>0,f=0,h=0;do{if(!a)break;var d=SB(e,a),p=d[0],m=d[1],y=d[2],g=m-y-o*p;(p||g)&&wB(e,a)&&(f+=g,h+=p);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&Math.abs(f)<1||!c&&Math.abs(h)<1)&&(u=!0),u},jp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},JT=function(e){return[e.deltaX,e.deltaY]},e_=function(e){return e&&"current"in e?e.current:e},dG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pG=function(e){return`
94
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
95
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
96
+ `)},mG=0,bl=[];function gG(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(mG++)[0],o=C.useState(bB)[0],s=C.useRef(e);C.useEffect(function(){s.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=LK([e.lockRef.current],(e.shards||[]).map(e_),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=jp(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-g[0],k="deltaY"in m?m.deltaY:v[1]-g[1],w,S=m.target,O=Math.abs(x)>Math.abs(k)?"h":"v";if("touches"in m&&O==="h"&&S.type==="range")return!1;var A=window.getSelection(),P=A&&A.anchorNode,M=P?P===S||P.contains(S):!1;if(M)return!1;var _=ZT(O,S);if(!_)return!0;if(_?w=O:(w=O==="v"?"h":"v",_=ZT(O,S)),!_)return!1;if(!r.current&&"changedTouches"in m&&(x||k)&&(r.current=w),!w)return!0;var E=r.current||w;return hG(E,y,m,E==="h"?x:k)},[]),l=C.useCallback(function(m){var y=m;if(!(!bl.length||bl[bl.length-1]!==o)){var g="deltaY"in y?JT(y):jp(y),v=t.current.filter(function(w){return w.name===y.type&&(w.target===y.target||y.target===w.shadowParent)&&dG(w.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var x=(s.current.shards||[]).map(e_).filter(Boolean).filter(function(w){return w.contains(y.target)}),k=x.length>0?a(y,x[0]):!s.current.noIsolation;k&&y.cancelable&&y.preventDefault()}}},[]),u=C.useCallback(function(m,y,g,v){var x={name:m,delta:y,target:g,should:v,shadowParent:yG(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(k){return k!==x})},1)},[]),c=C.useCallback(function(m){n.current=jp(m),r.current=void 0},[]),f=C.useCallback(function(m){u(m.type,JT(m),m.target,a(m,e.lockRef.current))},[]),h=C.useCallback(function(m){u(m.type,jp(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return bl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,vl),document.addEventListener("touchmove",l,vl),document.addEventListener("touchstart",c,vl),function(){bl=bl.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,vl),document.removeEventListener("touchmove",l,vl),document.removeEventListener("touchstart",c,vl)}},[]);var d=e.removeScrollBar,p=e.inert;return C.createElement(C.Fragment,null,p?C.createElement(o,{styles:pG(i)}):null,d?C.createElement(oG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function yG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vG=qK(vB,gG);var kB=C.forwardRef(function(e,t){return C.createElement(zv,Ti({},e,{ref:t,sideCar:vG}))});kB.classNames=zv.classNames;var bG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xl=new WeakMap,Rp=new WeakMap,Np={},Jb=0,OB=function(e){return e&&(e.host||OB(e.parentNode))},xG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=OB(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},wG=function(e,t,n,r){var i=xG(t,Array.isArray(e)?e:[e]);Np[n]||(Np[n]=new WeakMap);var o=Np[n],s=[],a=new Set,l=new Set(i),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};i.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))c(h);else try{var d=h.getAttribute(r),p=d!==null&&d!=="false",m=(xl.get(h)||0)+1,y=(o.get(h)||0)+1;xl.set(h,m),o.set(h,y),s.push(h),m===1&&p&&Rp.set(h,!0),y===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return c(t),a.clear(),Jb++,function(){s.forEach(function(f){var h=xl.get(f)-1,d=o.get(f)-1;xl.set(f,h),o.set(f,d),h||(Rp.has(f)||f.removeAttribute(r),Rp.delete(f)),d||f.removeAttribute(n)}),Jb--,Jb||(xl=new WeakMap,xl=new WeakMap,Rp=new WeakMap,Np={})}},SG=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=bG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),wG(r,i,n,"aria-hidden")):function(){return null}},Wv="Dialog",[CB]=nK(Wv),[kG,gi]=CB(Wv),AB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=C.useRef(null),l=C.useRef(null),[u,c]=aK({prop:r,defaultProp:i??!1,onChange:o,caller:Wv});return b.jsx(kG,{scope:t,triggerRef:a,contentRef:l,contentId:go(),titleId:go(),descriptionId:go(),open:u,onOpenChange:c,onOpenToggle:C.useCallback(()=>c(f=>!f),[c]),modal:s,children:n})};AB.displayName=Wv;var PB="DialogTrigger",OG=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(PB,n),o=il(t,i.triggerRef);return b.jsx(No.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":RC(i.open),...r,ref:o,onClick:bs(e.onClick,i.onOpenToggle)})});OG.displayName=PB;var IC="DialogPortal",[CG,EB]=CB(IC,{forceMount:void 0}),TB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=gi(IC,t);return b.jsx(CG,{scope:t,forceMount:n,children:C.Children.map(r,s=>b.jsx(Fv,{present:n||o.open,children:b.jsx(mB,{asChild:!0,container:i,children:s})}))})};TB.displayName=IC;var Mg="DialogOverlay",_B=C.forwardRef((e,t)=>{const n=EB(Mg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=gi(Mg,e.__scopeDialog);return o.modal?b.jsx(Fv,{present:r||o.open,children:b.jsx(PG,{...i,ref:t})}):null});_B.displayName=Mg;var AG=uB("DialogOverlay.RemoveScroll"),PG=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(Mg,n);return b.jsx(kB,{as:AG,allowPinchZoom:!0,shards:[i.contentRef],children:b.jsx(No.div,{"data-state":RC(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ua="DialogContent",MB=C.forwardRef((e,t)=>{const n=EB(Ua,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=gi(Ua,e.__scopeDialog);return b.jsx(Fv,{present:r||o.open,children:o.modal?b.jsx(EG,{...i,ref:t}):b.jsx(TG,{...i,ref:t})})});MB.displayName=Ua;var EG=C.forwardRef((e,t)=>{const n=gi(Ua,e.__scopeDialog),r=C.useRef(null),i=il(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return SG(o)},[]),b.jsx(IB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bs(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:bs(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:bs(e.onFocusOutside,o=>o.preventDefault())})}),TG=C.forwardRef((e,t)=>{const n=gi(Ua,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return b.jsx(IB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;n.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),IB=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=gi(Ua,n),l=C.useRef(null),u=il(t,l);return DK(),b.jsxs(b.Fragment,{children:[b.jsx(dB,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:b.jsx(fB,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":RC(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(jG,{titleId:a.titleId}),b.jsx(NG,{contentRef:l,descriptionId:a.descriptionId})]})]})}),jC="DialogTitle",_G=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(jC,n);return b.jsx(No.h2,{id:i.titleId,...r,ref:t})});_G.displayName=jC;var jB="DialogDescription",MG=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(jB,n);return b.jsx(No.p,{id:i.descriptionId,...r,ref:t})});MG.displayName=jB;var RB="DialogClose",IG=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(RB,n);return b.jsx(No.button,{type:"button",...r,ref:t,onClick:bs(e.onClick,()=>i.onOpenChange(!1))})});IG.displayName=RB;function RC(e){return e?"open":"closed"}var NB="DialogTitleWarning",[k$e,DB]=tK(NB,{contentName:Ua,titleName:jC,docsSlug:"dialog"}),jG=({titleId:e})=>{const t=DB(NB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
97
+
98
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
99
+
100
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},RG="DialogDescriptionWarning",NG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DB(RG).contentName}}.`;return C.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},DG=AB,LG=TB,$G=_B,BG=MB,FG=Symbol.for("react.lazy"),Ig=_O[" use ".trim().toString()];function zG(e){return typeof e=="object"&&e!==null&&"then"in e}function LB(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===FG&&"_payload"in e&&zG(e._payload)}function WG(e){const t=UG(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;LB(o)&&typeof Ig=="function"&&(o=Ig(o._payload));const a=C.Children.toArray(o),l=a.find(VG);if(l){const u=l.props.children,c=a.map(f=>f===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:f);return b.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,c):null})}return b.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function UG(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(LB(i)&&typeof Ig=="function"&&(i=Ig(i._payload)),C.isValidElement(i)){const s=KG(i),a=qG(o,i.props);return i.type!==C.Fragment&&(a.ref=r?Cs(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var HG=Symbol("radix.slottable");function VG(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===HG}function qG(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function KG(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var GG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$s=GG.reduce((e,t)=>{const n=WG(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),rf='[cmdk-group=""]',ex='[cmdk-group-items=""]',QG='[cmdk-group-heading=""]',$B='[cmdk-item=""]',t_=`${$B}:not([aria-disabled="true"])`,jw="cmdk-item-select",Pl="data-value",XG=(e,t,n)=>eK(e,t,n),BB=C.createContext(void 0),qd=()=>C.useContext(BB),FB=C.createContext(void 0),NC=()=>C.useContext(FB),zB=C.createContext(void 0),WB=C.forwardRef((e,t)=>{let n=El(()=>{var D,I;return{search:"",value:(I=(D=e.value)!=null?D:e.defaultValue)!=null?I:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=El(()=>new Set),i=El(()=>new Map),o=El(()=>new Map),s=El(()=>new Set),a=UB(e),{label:l,children:u,value:c,onValueChange:f,filter:h,shouldFilter:d,loop:p,disablePointerSelection:m=!1,vimBindings:y=!0,...g}=e,v=go(),x=go(),k=go(),w=C.useRef(null),S=aQ();Ha(()=>{if(c!==void 0){let D=c.trim();n.current.value=D,O.emit()}},[c]),Ha(()=>{S(6,R)},[]);let O=C.useMemo(()=>({subscribe:D=>(s.current.add(D),()=>s.current.delete(D)),snapshot:()=>n.current,setState:(D,I,Y)=>{var G,te,fe,ye;if(!Object.is(n.current[D],I)){if(n.current[D]=I,D==="search")E(),M(),S(1,_);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(k);Q?Q.focus():(G=document.getElementById(v))==null||G.focus()}if(S(7,()=>{var Q;n.current.selectedItemId=(Q=N())==null?void 0:Q.id,O.emit()}),Y||S(5,R),((te=a.current)==null?void 0:te.value)!==void 0){let Q=I??"";(ye=(fe=a.current).onValueChange)==null||ye.call(fe,Q);return}}O.emit()}},emit:()=>{s.current.forEach(D=>D())}}),[]),A=C.useMemo(()=>({value:(D,I,Y)=>{var G;I!==((G=o.current.get(D))==null?void 0:G.value)&&(o.current.set(D,{value:I,keywords:Y}),n.current.filtered.items.set(D,P(I,Y)),S(2,()=>{M(),O.emit()}))},item:(D,I)=>(r.current.add(D),I&&(i.current.has(I)?i.current.get(I).add(D):i.current.set(I,new Set([D]))),S(3,()=>{E(),M(),n.current.value||_(),O.emit()}),()=>{o.current.delete(D),r.current.delete(D),n.current.filtered.items.delete(D);let Y=N();S(4,()=>{E(),Y?.getAttribute("id")===D&&_(),O.emit()})}),group:D=>(i.current.has(D)||i.current.set(D,new Set),()=>{o.current.delete(D),i.current.delete(D)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:v,inputId:k,labelId:x,listInnerRef:w}),[]);function P(D,I){var Y,G;let te=(G=(Y=a.current)==null?void 0:Y.filter)!=null?G:XG;return D?te(D,n.current.search,I):0}function M(){if(!n.current.search||a.current.shouldFilter===!1)return;let D=n.current.filtered.items,I=[];n.current.filtered.groups.forEach(G=>{let te=i.current.get(G),fe=0;te.forEach(ye=>{let Q=D.get(ye);fe=Math.max(Q,fe)}),I.push([G,fe])});let Y=w.current;j().sort((G,te)=>{var fe,ye;let Q=G.getAttribute("id"),ue=te.getAttribute("id");return((fe=D.get(ue))!=null?fe:0)-((ye=D.get(Q))!=null?ye:0)}).forEach(G=>{let te=G.closest(ex);te?te.appendChild(G.parentElement===te?G:G.closest(`${ex} > *`)):Y.appendChild(G.parentElement===Y?G:G.closest(`${ex} > *`))}),I.sort((G,te)=>te[1]-G[1]).forEach(G=>{var te;let fe=(te=w.current)==null?void 0:te.querySelector(`${rf}[${Pl}="${encodeURIComponent(G[0])}"]`);fe?.parentElement.appendChild(fe)})}function _(){let D=j().find(Y=>Y.getAttribute("aria-disabled")!=="true"),I=D?.getAttribute(Pl);O.setState("value",I||void 0)}function E(){var D,I,Y,G;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let fe of r.current){let ye=(I=(D=o.current.get(fe))==null?void 0:D.value)!=null?I:"",Q=(G=(Y=o.current.get(fe))==null?void 0:Y.keywords)!=null?G:[],ue=P(ye,Q);n.current.filtered.items.set(fe,ue),ue>0&&te++}for(let[fe,ye]of i.current)for(let Q of ye)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(fe);break}n.current.filtered.count=te}function R(){var D,I,Y;let G=N();G&&(((D=G.parentElement)==null?void 0:D.firstChild)===G&&((Y=(I=G.closest(rf))==null?void 0:I.querySelector(QG))==null||Y.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function N(){var D;return(D=w.current)==null?void 0:D.querySelector(`${$B}[aria-selected="true"]`)}function j(){var D;return Array.from(((D=w.current)==null?void 0:D.querySelectorAll(t_))||[])}function B(D){let I=j()[D];I&&O.setState("value",I.getAttribute(Pl))}function F(D){var I;let Y=N(),G=j(),te=G.findIndex(ye=>ye===Y),fe=G[te+D];(I=a.current)!=null&&I.loop&&(fe=te+D<0?G[G.length-1]:te+D===G.length?G[0]:G[te+D]),fe&&O.setState("value",fe.getAttribute(Pl))}function $(D){let I=N(),Y=I?.closest(rf),G;for(;Y&&!G;)Y=D>0?oQ(Y,rf):sQ(Y,rf),G=Y?.querySelector(t_);G?O.setState("value",G.getAttribute(Pl)):F(D)}let z=()=>B(j().length-1),T=D=>{D.preventDefault(),D.metaKey?z():D.altKey?$(1):F(1)},q=D=>{D.preventDefault(),D.metaKey?B(0):D.altKey?$(-1):F(-1)};return C.createElement($s.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:D=>{var I;(I=g.onKeyDown)==null||I.call(g,D);let Y=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||Y))switch(D.key){case"n":case"j":{y&&D.ctrlKey&&T(D);break}case"ArrowDown":{T(D);break}case"p":case"k":{y&&D.ctrlKey&&q(D);break}case"ArrowUp":{q(D);break}case"Home":{D.preventDefault(),B(0);break}case"End":{D.preventDefault(),z();break}case"Enter":{D.preventDefault();let G=N();if(G){let te=new Event(jw);G.dispatchEvent(te)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:uQ},l),Uv(e,D=>C.createElement(FB.Provider,{value:O},C.createElement(BB.Provider,{value:A},D))))}),YG=C.forwardRef((e,t)=>{var n,r;let i=go(),o=C.useRef(null),s=C.useContext(zB),a=qd(),l=UB(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;Ha(()=>{if(!u)return a.item(i,s?.id)},[u]);let c=HB(i,o,[e.value,e.children,o],e.keywords),f=NC(),h=As(S=>S.value&&S.value===c.current),d=As(S=>u||a.filter()===!1?!0:S.search?S.filtered.items.get(i)>0:!0);C.useEffect(()=>{let S=o.current;if(!(!S||e.disabled))return S.addEventListener(jw,p),()=>S.removeEventListener(jw,p)},[d,e.onSelect,e.disabled]);function p(){var S,O;m(),(O=(S=l.current).onSelect)==null||O.call(S,c.current)}function m(){f.setState("value",c.current,!0)}if(!d)return null;let{disabled:y,value:g,onSelect:v,forceMount:x,keywords:k,...w}=e;return C.createElement($s.div,{ref:Cs(o,t),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||a.getDisablePointerSelection()?void 0:m,onClick:y?void 0:p},e.children)}),ZG=C.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=go(),a=C.useRef(null),l=C.useRef(null),u=go(),c=qd(),f=As(d=>i||c.filter()===!1?!0:d.search?d.filtered.groups.has(s):!0);Ha(()=>c.group(s),[]),HB(s,a,[e.value,e.heading,l]);let h=C.useMemo(()=>({id:s,forceMount:i}),[i]);return C.createElement($s.div,{ref:Cs(a,t),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&C.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Uv(e,d=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},C.createElement(zB.Provider,{value:h},d))))}),JG=C.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=C.useRef(null),o=As(s=>!s.search);return!n&&!o?null:C.createElement($s.div,{ref:Cs(i,t),...r,"cmdk-separator":"",role:"separator"})}),eQ=C.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=NC(),s=As(u=>u.search),a=As(u=>u.selectedItemId),l=qd();return C.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),C.createElement($s.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:i?e.value:s,onChange:u=>{i||o.setState("search",u.target.value),n?.(u.target.value)}})}),tQ=C.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=C.useRef(null),s=C.useRef(null),a=As(u=>u.selectedItemId),l=qd();return C.useEffect(()=>{if(s.current&&o.current){let u=s.current,c=o.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let d=u.offsetHeight;c.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),C.createElement($s.div,{ref:Cs(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Uv(e,u=>C.createElement("div",{ref:Cs(s,l.listInnerRef),"cmdk-list-sizer":""},u)))}),nQ=C.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return C.createElement(DG,{open:n,onOpenChange:r},C.createElement(LG,{container:s},C.createElement($G,{"cmdk-overlay":"",className:i}),C.createElement(BG,{"aria-label":e.label,"cmdk-dialog":"",className:o},C.createElement(WB,{ref:t,...a}))))}),rQ=C.forwardRef((e,t)=>As(n=>n.filtered.count===0)?C.createElement($s.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),iQ=C.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return C.createElement($s.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Uv(e,s=>C.createElement("div",{"aria-hidden":!0},s)))}),nn=Object.assign(WB,{List:tQ,Item:YG,Input:eQ,Group:ZG,Separator:JG,Dialog:nQ,Empty:rQ,Loading:iQ});function oQ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function sQ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function UB(e){let t=C.useRef(e);return Ha(()=>{t.current=e}),t}var Ha=typeof window>"u"?C.useEffect:C.useLayoutEffect;function El(e){let t=C.useRef();return t.current===void 0&&(t.current=e()),t}function As(e){let t=NC(),n=()=>e(t.snapshot());return C.useSyncExternalStore(t.subscribe,n,n)}function HB(e,t,n,r=[]){let i=C.useRef(),o=qd();return Ha(()=>{var s;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():i.current}})(),l=r.map(u=>u.trim());o.value(e,a,l),(s=t.current)==null||s.setAttribute(Pl,a),i.current=a}),i}var aQ=()=>{let[e,t]=C.useState(),n=El(()=>new Map);return Ha(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function lQ(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Uv({asChild:e,children:t},n){return e&&C.isValidElement(t)?C.cloneElement(lQ(t),{ref:t.ref},n(t.props.children)):n(t)}var uQ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};/**
101
+ * @license lucide-react v0.460.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const cQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),VB=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
106
+ * @license lucide-react v0.460.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */var fQ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
111
+ * @license lucide-react v0.460.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const hQ=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>C.createElement("svg",{ref:l,...fQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:VB("lucide",i),...a},[...s.map(([u,c])=>C.createElement(u,c)),...Array.isArray(o)?o:[o]]));/**
116
+ * @license lucide-react v0.460.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Ve=(e,t)=>{const n=C.forwardRef(({className:r,...i},o)=>C.createElement(hQ,{ref:o,iconNode:t,className:VB(`lucide-${cQ(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
121
+ * @license lucide-react v0.460.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const dQ=Ve("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
126
+ * @license lucide-react v0.460.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const pQ=Ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
131
+ * @license lucide-react v0.460.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const qB=Ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
136
+ * @license lucide-react v0.460.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const mQ=Ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
141
+ * @license lucide-react v0.460.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const KB=Ve("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
146
+ * @license lucide-react v0.460.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const GB=Ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
151
+ * @license lucide-react v0.460.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const gQ=Ve("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
156
+ * @license lucide-react v0.460.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const yQ=Ve("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
161
+ * @license lucide-react v0.460.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const DC=Ve("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
166
+ * @license lucide-react v0.460.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const vQ=Ve("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
171
+ * @license lucide-react v0.460.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const QB=Ve("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
176
+ * @license lucide-react v0.460.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const Rw=Ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
181
+ * @license lucide-react v0.460.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const XB=Ve("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
186
+ * @license lucide-react v0.460.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const LC=Ve("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
191
+ * @license lucide-react v0.460.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const YB=Ve("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
196
+ * @license lucide-react v0.460.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const bQ=Ve("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
201
+ * @license lucide-react v0.460.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const xQ=Ve("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
206
+ * @license lucide-react v0.460.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const $C=Ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
211
+ * @license lucide-react v0.460.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const wQ=Ve("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
216
+ * @license lucide-react v0.460.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const BC=Ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
221
+ * @license lucide-react v0.460.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const Hf=Ve("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
226
+ * @license lucide-react v0.460.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const ZB=Ve("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
231
+ * @license lucide-react v0.460.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const JB=Ve("SquareKanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]);/**
236
+ * @license lucide-react v0.460.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const eF=Ve("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
241
+ * @license lucide-react v0.460.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const Nh=Ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
246
+ * @license lucide-react v0.460.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const tF=Ve("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
251
+ * @license lucide-react v0.460.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const SQ=Ve("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
256
+ * @license lucide-react v0.460.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const nF=Ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rF="squad.console.density";function kQ(){return typeof window>"u"?"comfortable":window.localStorage.getItem(rF)==="compact"?"compact":"comfortable"}function OQ(e){typeof document>"u"||(document.documentElement.dataset.density=e)}function iF(){const[e,t]=C.useState(kQ);C.useEffect(()=>{OQ(e),typeof window<"u"&&window.localStorage.setItem(rF,e)},[e]);const n=C.useCallback(i=>t(i),[]),r=C.useCallback(()=>t(i=>i==="compact"?"comfortable":"compact"),[]);return{density:e,setDensity:n,toggle:r}}const CQ=[{id:"pg-dashboard",label:"Dashboard",to:"/",Icon:XB,hint:"g d"},{id:"pg-stories",label:"Stories",to:"/stories",Icon:LC,hint:"g s"},{id:"pg-plans",label:"Plans",to:"/plans",Icon:DC,hint:"g p"},{id:"pg-generate",label:"Generate plan",to:"/generate",Icon:ZB,hint:"g r"},{id:"pg-config",label:"Config",to:"/config",Icon:Hf,hint:"g c"},{id:"pg-secrets",label:"Secrets",to:"/secrets",Icon:YB,hint:"g k"},{id:"pg-tracker",label:"Tracker",to:"/tracker",Icon:JB,hint:"g t"},{id:"pg-doctor",label:"Doctor",to:"/doctor",Icon:eF,hint:"g h"}];function AQ(){const[e,t]=C.useState(!1),[n,r]=C.useState(""),i=mi(),{toggle:o}=iF();C.useEffect(()=>{const f=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),t(p=>!p))},h=()=>t(!0);return window.addEventListener("keydown",f),window.addEventListener("squad:cmdk:open",h),()=>{window.removeEventListener("keydown",f),window.removeEventListener("squad:cmdk:open",h)}},[]);const s=Jt({queryKey:["stories"],queryFn:()=>Be("/api/stories"),enabled:e}),a=Jt({queryKey:["plans"],queryFn:()=>Be("/api/plans"),enabled:e}),l=(s.data??[]).slice(0,5),u=(a.data??[]).slice(0,5),c=()=>{t(!1),r("")};return e?nl.createPortal(b.jsx("div",{role:"presentation",onMouseDown:f=>{f.target===f.currentTarget&&c()},className:"fixed inset-0 z-[var(--z-modal)] flex items-start justify-center p-4 pt-[12vh] animate-fade-in",style:{background:"rgba(0,0,0,0.6)"},children:b.jsx("div",{className:"w-full max-w-xl overflow-hidden rounded-[var(--radius-xl)] border border-[var(--color-border)] bg-[var(--color-bg-elevated)] shadow-2xl animate-fade-up",children:b.jsxs(nn,{label:"Command palette",value:n,onValueChange:r,loop:!0,children:[b.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-border)] px-3 py-2",children:[b.jsx(BC,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx(nn.Input,{placeholder:"Type a command or search…",className:"flex-1 bg-transparent py-1.5 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-dim)] outline-none",autoFocus:!0})]}),b.jsxs(nn.List,{className:"max-h-[60vh] overflow-auto p-1.5",children:[b.jsx(nn.Empty,{className:"px-3 py-6 text-center text-sm text-[var(--color-text-muted)]",children:"No matches."}),b.jsx(nn.Group,{heading:"Pages",className:"mb-2",children:CQ.map(f=>b.jsxs(nn.Item,{value:`page ${f.label}`,onSelect:()=>{i({to:f.to}),c()},className:"cmdk-row",children:[b.jsx(f.Icon,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:f.label}),b.jsx("span",{className:"kbd",children:f.hint})]},f.id))}),b.jsxs(nn.Group,{heading:"Actions",className:"mb-2",children:[b.jsxs(nn.Item,{value:"action new story",onSelect:()=>{i({to:"/stories"}),window.dispatchEvent(new CustomEvent("squad:dialog:new-story")),c()},className:"cmdk-row",children:[b.jsx($C,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:"New story"}),b.jsx("span",{className:"kbd",children:"n s"})]}),b.jsxs(nn.Item,{value:"action generate plan from latest unplanned story",onSelect:()=>{i({to:"/generate"}),c()},className:"cmdk-row",children:[b.jsx(gQ,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:"Generate plan from latest unplanned story"})]}),b.jsxs(nn.Item,{value:"action run doctor",onSelect:()=>{i({to:"/doctor"}),c()},className:"cmdk-row",children:[b.jsx(dQ,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:"Run doctor"})]}),b.jsxs(nn.Item,{value:"action open config",onSelect:()=>{i({to:"/config"}),c()},className:"cmdk-row",children:[b.jsx(Hf,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:"Open config"})]}),b.jsxs(nn.Item,{value:"action switch density",onSelect:()=>{o(),c()},className:"cmdk-row",children:[b.jsx(Hf,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:"Switch density"})]}),b.jsxs(nn.Item,{value:"action keyboard shortcuts",onSelect:()=>{c(),window.dispatchEvent(new CustomEvent("squad:dialog:shortcuts"))},className:"cmdk-row",children:[b.jsx(Hf,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"flex-1",children:"Open keyboard shortcuts"}),b.jsx("span",{className:"kbd",children:"?"})]})]}),l.length>0?b.jsx(nn.Group,{heading:"Recent stories",className:"mb-2",children:l.map(f=>b.jsxs(nn.Item,{value:`story ${f.feature} ${f.id} ${f.titleHint??""}`,onSelect:()=>{i({to:"/stories/$feature/$id",params:{feature:f.feature,id:f.id}}),c()},className:"cmdk-row",children:[b.jsx(LC,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsxs("span",{className:"font-mono text-[12px] text-[var(--color-text-muted)]",children:[f.feature,"/"]}),b.jsx("span",{className:"flex-1 truncate",children:f.titleHint||f.id})]},`s-${f.feature}-${f.id}`))}):null,u.length>0?b.jsx(nn.Group,{heading:"Recent plans",children:u.map(f=>b.jsxs(nn.Item,{value:`plan ${f.feature} ${f.planFile}`,onSelect:()=>{i({to:"/plans/$feature/$planFile",params:{feature:f.feature,planFile:f.planFile}}),c()},className:"cmdk-row",children:[b.jsx(DC,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsxs("span",{className:"font-mono text-[12px] text-[var(--color-text-muted)]",children:[f.feature,"/"]}),b.jsx("span",{className:"flex-1 truncate",children:f.planFile})]},`p-${f.feature}-${f.planFile}`))}):null]})]})})}),document.body):null}const PQ={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function Sc({open:e,title:t,description:n,children:r,onClose:i,footer:o,size:s="md",dismissible:a=!0}){const l=C.useRef(null),u=C.useRef(null);C.useEffect(()=>{e?u.current=document.activeElement??null:u.current&&document.contains(u.current)&&(u.current.focus(),u.current=null)},[e]),C.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=f}},[e]),C.useEffect(()=>{if(!e)return;const f=window.setTimeout(()=>{const h=l.current;if(!h)return;(h.querySelector('a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])')??h).focus()},0);return()=>window.clearTimeout(f)},[e]);const c=C.useCallback(f=>{if(f.key==="Escape"&&a){f.stopPropagation(),i();return}if(f.key!=="Tab")return;const h=l.current;if(!h)return;const d=Array.from(h.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(g=>!g.hasAttribute("aria-hidden"));if(d.length===0)return;const p=d[0],m=d[d.length-1],y=document.activeElement;f.shiftKey&&y===p?(f.preventDefault(),m.focus()):!f.shiftKey&&y===m&&(f.preventDefault(),p.focus())},[a,i]);return e?nl.createPortal(b.jsx("div",{role:"presentation",onMouseDown:f=>{a&&f.target===f.currentTarget&&i()},onKeyDown:c,className:"fixed inset-0 z-[var(--z-modal)] flex items-center justify-center p-4 animate-fade-in",style:{background:"rgba(0, 0, 0, 0.6)"},children:b.jsxs("div",{ref:l,role:"dialog","aria-modal":"true","aria-labelledby":"squad-dialog-title",tabIndex:-1,className:`relative w-full ${PQ[s]} rounded-[var(--radius-xl)] border border-[var(--color-border)] bg-[var(--color-bg-elevated)] shadow-2xl outline-none animate-fade-up`,children:[b.jsxs("div",{className:"border-b border-[var(--color-border)] px-5 py-3",children:[b.jsx("div",{id:"squad-dialog-title",className:"text-sm font-semibold text-[var(--color-text)]",children:t}),n?b.jsx("p",{className:"mt-1 text-xs text-[var(--color-text-muted)]",children:n}):null]}),b.jsx("div",{className:"px-5 py-4 text-sm text-[var(--color-text)]",children:r}),b.jsx("div",{className:"flex justify-end gap-2 border-t border-[var(--color-border)] px-5 py-3",children:o??b.jsx("button",{type:"button",className:"btn-secondary",onClick:i,children:"Close"})})]})}),document.body):null}const EQ={xs:10,sm:12,md:16,lg:20};function Hv({size:e="md",style:t,className:n="",...r}){const i=EQ[e],o={width:i,height:i,borderWidth:Math.max(1,Math.floor(i/8)),borderStyle:"solid",borderColor:"currentColor",borderTopColor:"transparent",borderRadius:"999px",display:"inline-block",animation:"spin 0.7s linear infinite",...t};return b.jsx("span",{role:"status","aria-label":"Loading",style:o,className:n,...r})}const TQ={primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost",danger:"btn-danger"},_Q={sm:"px-2.5 py-1 text-[13px]",md:""},be=C.forwardRef(function({variant:t="primary",size:n="md",loading:r=!1,leftIcon:i,rightIcon:o,className:s="",disabled:a,children:l,...u},c){return b.jsxs("button",{ref:c,className:`${TQ[t]} ${_Q[n]} ${s}`.trim(),disabled:a||r,"data-loading":r||void 0,...u,children:[r?b.jsx(Hv,{size:"sm","aria-hidden":!0}):i,b.jsx("span",{children:l}),!r&&o]})}),oF=C.createContext(null);function Vv(){const e=C.useContext(oF);if(!e)throw new Error("useConfirm must be used inside <ConfirmProvider>");return e.confirm}function MQ({children:e}){const[t,n]=C.useState(null),r=C.useCallback(o=>new Promise(s=>{n({options:typeof o=="string"?{title:o}:o,resolve:s})}),[]),i=o=>{t&&(t.resolve(o),n(null))};return b.jsxs(oF.Provider,{value:{confirm:r},children:[e,b.jsx(Sc,{open:t!==null,title:t?.options.title??"",description:t?.options.description,size:"sm",onClose:()=>i(!1),footer:b.jsxs(b.Fragment,{children:[b.jsx(be,{type:"button",variant:"ghost",onClick:()=>i(!1),children:t?.options.cancelLabel??"Cancel"}),b.jsx(be,{type:"button",variant:t?.options.tone==="danger"?"danger":"primary",onClick:()=>i(!0),children:t?.options.confirmLabel??"Confirm"})]}),children:null})]})}function Fi({className:e="",children:t,...n}){return b.jsx("span",{className:`kbd ${e}`,...n,children:t})}const IQ=[{title:"Navigation",rows:[{keys:["g","d"],label:"Dashboard"},{keys:["g","s"],label:"Stories"},{keys:["g","p"],label:"Plans"},{keys:["g","r"],label:"Generate plan"},{keys:["g","c"],label:"Config"},{keys:["g","k"],label:"Secrets"},{keys:["g","t"],label:"Tracker"},{keys:["g","h"],label:"Doctor"}]},{title:"Actions",rows:[{keys:["⌘","K"],label:"Open command palette"},{keys:["n","s"],label:"New story"},{keys:["?"],label:"Show this cheatsheet"},{keys:["Esc"],label:"Close any dialog"}]}];function jQ(){const[e,t]=C.useState(!1);return C.useEffect(()=>{const n=()=>t(!0);return window.addEventListener("squad:dialog:shortcuts",n),()=>window.removeEventListener("squad:dialog:shortcuts",n)},[]),b.jsx(Sc,{open:e,onClose:()=>t(!1),title:"Keyboard shortcuts",size:"md",children:b.jsx("div",{className:"space-y-5",children:IQ.map(n=>b.jsxs("div",{children:[b.jsx("div",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:n.title}),b.jsx("ul",{className:"space-y-1.5",children:n.rows.map(r=>b.jsxs("li",{className:"flex items-center justify-between text-[13px]",children:[b.jsx("span",{className:"text-[var(--color-text)]",children:r.label}),b.jsx("span",{className:"flex items-center gap-1",children:r.keys.map(i=>b.jsx(Fi,{children:i},`${r.label}-${i}`))})]},r.label))})]},n.title))})})}const sF=C.createContext(null);function Do(){const e=C.useContext(sF);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}const RQ={default:null,success:b.jsx(GB,{size:14,className:"text-[var(--color-ok)]","aria-hidden":!0}),warning:b.jsx(tF,{size:14,className:"text-[var(--color-warn)]","aria-hidden":!0}),danger:b.jsx(KB,{size:14,className:"text-[var(--color-fail)]","aria-hidden":!0}),info:b.jsx(Rw,{size:14,className:"text-[var(--color-info)]","aria-hidden":!0})};let n_=0;function NQ(){return n_+=1,`t${n_}`}function DQ({children:e}){const[t,n]=C.useState([]),r=C.useRef(new Map),i=C.useCallback(s=>{n(l=>l.filter(u=>u.id!==s));const a=r.current.get(s);a&&(window.clearTimeout(a),r.current.delete(s))},[]),o=C.useCallback(s=>{const a=typeof s=="string"?{title:s}:s,l=a.id??NQ(),u={id:l,tone:a.tone??"default",duration:a.duration??4500,title:a.title,description:a.description,action:a.action};if(n(c=>[...c,u]),u.duration>0){const c=window.setTimeout(()=>i(l),u.duration);r.current.set(l,c)}return l},[i]);return C.useEffect(()=>()=>{for(const s of r.current.values())window.clearTimeout(s);r.current.clear()},[]),b.jsxs(sF.Provider,{value:{toast:o,dismiss:i},children:[e,nl.createPortal(b.jsx("ol",{"aria-live":"polite","aria-atomic":"false",className:"pointer-events-none fixed bottom-6 right-6 z-[var(--z-toast)] flex w-[min(calc(100vw-3rem),360px)] flex-col gap-2",children:t.map(s=>b.jsx("li",{className:"pointer-events-auto rounded-[var(--radius-md)] border border-[var(--color-border-strong)] bg-[var(--gray-3)] px-3 py-2 text-sm text-[var(--color-text)] shadow-2xl animate-fade-up",children:b.jsxs("div",{className:"flex items-start gap-2",children:[RQ[s.tone],b.jsxs("div",{className:"min-w-0 flex-1",children:[s.title?b.jsx("div",{className:"font-medium leading-snug",children:s.title}):null,s.description?b.jsx("div",{className:"mt-0.5 text-xs text-[var(--color-text-muted)]",children:s.description}):null,s.action?b.jsx("button",{type:"button",className:"mt-1.5 text-xs font-medium text-[var(--color-accent)] hover:underline",onClick:()=>{s.action?.onClick(),i(s.id)},children:s.action.label}):null]}),b.jsx("button",{type:"button","aria-label":"Dismiss",onClick:()=>i(s.id),className:"rounded-[var(--radius-sm)] p-0.5 text-[var(--color-text-dim)] hover:text-[var(--color-text)]",children:b.jsx(nF,{size:14})})]})},s.id))}),document.body)]})}const LQ=1200,r_={d:"/",s:"/stories",p:"/plans",r:"/generate",c:"/config",k:"/secrets",t:"/tracker",h:"/doctor"};function $Q(e){if(!e||!(e instanceof Element))return!1;if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)return!0;const t=e.getAttribute("contenteditable");return t===""||t==="true"||e.tagName==="SELECT"}function BQ(){const e=mi();C.useEffect(()=>{let t=null,n=0;const r=i=>{if(i.metaKey||i.ctrlKey||i.altKey||$Q(i.target))return;const o=i.key.toLowerCase();if(i.key==="?"){i.preventDefault(),window.dispatchEvent(new CustomEvent("squad:dialog:shortcuts")),t=null;return}if(t&&Date.now()-n>LQ&&(t=null),t==="g"&&r_[o]){i.preventDefault(),e({to:r_[o]}),t=null;return}if(t==="n"&&o==="s"){i.preventDefault(),e({to:"/stories"}),window.dispatchEvent(new CustomEvent("squad:dialog:new-story")),t=null;return}o==="g"||o==="n"?(t=o,n=Date.now()):t=null};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e])}const Nr=C.forwardRef(function({className:t="",style:n,...r},i){return b.jsx("div",{ref:i,style:{background:"linear-gradient(90deg, var(--gray-3) 0%, var(--gray-4) 50%, var(--gray-3) 100%)",backgroundSize:"200% 100%",animation:"skeleton-shimmer 1.4s linear infinite",...n},className:`rounded-[var(--radius-sm)] ${t}`,...r})}),FQ={default:{fg:"var(--color-text-muted)",bg:"var(--gray-2)",border:"var(--color-border)"},success:{fg:"var(--color-ok)",bg:"var(--color-ok-bg)",border:"var(--color-ok-border)"},warning:{fg:"var(--color-warn)",bg:"var(--color-warn-bg)",border:"var(--color-warn-border)"},danger:{fg:"var(--color-fail)",bg:"var(--color-fail-bg)",border:"var(--color-fail-border)"},info:{fg:"var(--color-info)",bg:"var(--color-info-bg)",border:"var(--color-info-border)"},ok:{fg:"var(--color-ok)",bg:"var(--color-ok-bg)",border:"var(--color-ok-border)"},warn:{fg:"var(--color-warn)",bg:"var(--color-warn-bg)",border:"var(--color-warn-border)"},fail:{fg:"var(--color-fail)",bg:"var(--color-fail-bg)",border:"var(--color-fail-border)"},muted:{fg:"var(--color-text-muted)",bg:"var(--gray-2)",border:"var(--color-border)"}},Et=C.forwardRef(function({tone:t="default",dot:n,className:r="",children:i,...o},s){const a=FQ[t];return b.jsxs("span",{ref:s,style:{color:a.fg,background:a.bg,borderColor:a.border},className:`inline-flex items-center gap-1.5 rounded-[var(--radius-sm)] border px-2 py-0.5 text-[11px] font-medium tabular ${r}`,...o,children:[n?b.jsx("span",{style:{background:a.fg},className:"h-1.5 w-1.5 rounded-full"}):null,i]})}),zQ=[{heading:"Workspace",items:[{to:"/",label:"Dashboard",Icon:XB,exact:!0},{to:"/stories",label:"Stories",Icon:LC},{to:"/plans",label:"Plans",Icon:DC}]},{heading:"Run",items:[{to:"/generate",label:"Generate plan",Icon:ZB}]},{heading:"Settings",items:[{to:"/config",label:"Config",Icon:Hf},{to:"/secrets",label:"Secrets",Icon:YB},{to:"/tracker",label:"Tracker",Icon:JB},{to:"/doctor",label:"Doctor",Icon:eF}]}],i_="group flex items-center gap-2.5 rounded-[var(--radius-md)] px-2.5 py-1.5 text-[13px] text-[var(--color-text-muted)] transition-colors hover:bg-[var(--gray-3)] hover:text-[var(--color-text)]",WQ="bg-[var(--gray-3)] text-[var(--color-text)]";function UQ(e){const t=e.split(/[/\\]/).filter(Boolean);return t.length?t[t.length-1]:e}function HQ(e){return/^[\w./:@+-]+$/.test(e)&&!e.includes("'")?e:`'${e.replace(/'/g,"'\\''")}'`}function VQ(){const e=Qi(),{toast:t}=Do(),n=Jt({queryKey:["meta"],queryFn:()=>Be("/api/meta")}),r=Jt({queryKey:["recent-projects"],queryFn:()=>Be("/api/projects/recent")}),[i,o]=C.useState(!1),s=C.useRef(null);C.useEffect(()=>{if(!i)return;const f=h=>{s.current&&!s.current.contains(h.target)&&o(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]);const a=n.data,l=a?.project.name??null,u=a?.root??"";async function c(f){if(!f||f===u){o(!1);return}const h=`cd ${HQ(f)} && squad console`;try{await navigator.clipboard.writeText(h),t({tone:"info",title:"Command copied",description:"Run it in another terminal to open this project."})}catch{t({tone:"warning",title:"Copy failed",description:h})}o(!1),e.invalidateQueries({queryKey:["recent-projects"]})}return b.jsxs("aside",{className:"sticky top-0 flex h-screen w-56 shrink-0 flex-col border-r border-[var(--color-border)] bg-[var(--gray-2)] px-3 py-4","aria-label":"Primary navigation",children:[b.jsxs("div",{className:"mb-3 flex items-center gap-2 px-1.5",children:[b.jsx("img",{src:"/logo.svg",alt:"",className:"h-6 w-6"}),b.jsxs("div",{className:"text-sm font-semibold tracking-tight text-[var(--color-text)]",children:["squad ",b.jsx("span",{className:"text-[var(--color-text-muted)]",children:"console"})]})]}),b.jsxs("div",{className:"relative mb-4 px-0.5",ref:s,children:[b.jsxs("button",{type:"button","aria-expanded":i,"aria-haspopup":"listbox",onClick:()=>o(f=>!f),className:"flex w-full items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-3)] px-2.5 py-2 text-left text-[13px] text-[var(--color-text)] transition-colors hover:bg-[var(--gray-4)]",children:[b.jsx(vQ,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.isPending?b.jsx(Nr,{className:"h-4 w-32"}):l??"—"}),b.jsx(qB,{size:14,className:"text-[var(--color-text-dim)]","aria-hidden":!0})]}),i&&!r.isPending?b.jsx("div",{role:"listbox",className:"absolute left-0 top-full z-[var(--z-overlay)] mt-1 max-h-72 w-full overflow-auto rounded-[var(--radius-md)] border border-[var(--color-border-strong)] bg-[var(--gray-3)] py-1 shadow-2xl",children:r.data&&r.data.length>0?r.data.map(f=>b.jsxs("button",{type:"button",role:"option","aria-selected":f.root===u,onClick:()=>c(f.root),className:"flex w-full flex-col items-start gap-0.5 px-2.5 py-1.5 text-left text-[12px] hover:bg-[var(--gray-4)]",children:[b.jsx("span",{className:"font-medium text-[var(--color-text)]",children:UQ(f.root)}),b.jsx("span",{className:"w-full truncate font-mono text-[10px] text-[var(--color-text-dim)]",children:f.root})]},f.root)):b.jsx("div",{className:"px-2.5 py-1.5 text-[12px] text-[var(--color-text-muted)]",children:"No recent projects yet."})}):null]}),b.jsx("nav",{className:"flex-1 space-y-4 overflow-auto",children:zQ.map(f=>b.jsxs("div",{children:[b.jsx("div",{className:"mb-1.5 px-2.5 text-[10px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:f.heading}),b.jsx("ul",{className:"space-y-0.5",children:f.items.map(h=>b.jsx("li",{children:b.jsxs(ln,{to:h.to,className:i_,activeProps:{className:`${i_} ${WQ}`},activeOptions:{exact:h.exact??!1},children:[b.jsx(h.Icon,{size:14,className:"text-[var(--color-text-dim)] group-hover:text-[var(--color-text)] group-aria-[current=page]:text-[var(--color-text)]","aria-hidden":!0}),b.jsx("span",{children:h.label})]})},h.to))})]},f.heading))}),b.jsxs("div",{className:"mt-3 space-y-2 border-t border-[var(--color-border)] pt-3 px-1.5",children:[b.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--color-text-dim)]",children:[b.jsxs("span",{children:["v",a?.version??"—"]}),a?.planner?b.jsx(Et,{tone:a.planner.enabled?"success":"default",dot:a.planner.enabled,children:a.planner.provider}):b.jsx(Et,{tone:"default",children:"planner off"})]}),b.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--color-text-dim)]",children:[b.jsx("span",{children:"Search"}),b.jsx(Fi,{children:"⌘K"})]})]})]})}const o_={"/":"Dashboard","/stories":"Stories","/plans":"Plans","/generate":"Generate plan","/config":"Config","/secrets":"Secrets","/tracker":"Tracker","/doctor":"Doctor"};function qQ(){const e=$q(),t=[];for(const i of e){const o=i.params??{};if(i.routeId==="__root__")continue;const s=i.pathname;if(o_[s]){t.push({label:o_[s],to:s});continue}if(s.startsWith("/stories/")&&o.feature&&o.id){t.push({label:"Stories",to:"/stories"}),t.push({label:o.feature,to:"/stories"}),t.push({label:o.id,to:s});continue}if(s.startsWith("/plans/")&&s.endsWith("/diff")&&o.feature){t.push({label:"Plans",to:"/plans"}),t.push({label:o.feature,to:"/plans"}),t.push({label:"diff",to:s});continue}if(s.startsWith("/plans/")&&o.feature&&o.planFile){t.push({label:"Plans",to:"/plans"}),t.push({label:o.feature,to:"/plans"}),t.push({label:o.planFile,to:s});continue}}const n=new Set,r=t.filter(i=>{const o=`${i.label}|${i.to}`;return n.has(o)?!1:(n.add(o),!0)});return r.length===0?null:b.jsx("nav",{"aria-label":"Breadcrumbs",className:"flex min-w-0 items-center gap-1 text-[13px]",children:r.map((i,o)=>{const s=o===r.length-1;return b.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[o>0?b.jsx(mQ,{size:12,className:"text-[var(--color-text-dim)]","aria-hidden":!0}):null,s?b.jsx("span",{className:"truncate font-medium text-[var(--color-text)]",children:i.label}):b.jsx(ln,{to:i.to,className:"truncate text-[var(--color-text-muted)] transition-colors hover:text-[var(--color-text)]",children:i.label})]},`${i.to}-${o}`)})})}function jg({label:e,children:t,side:n="top",delay:r=250}){const i=C.useId(),[o,s]=C.useState(!1),a=C.useRef(null),l=C.useCallback(()=>{a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{a.current=null,s(!0)},r)},[r]),u=C.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),s(!1)},[]);return C.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current)},[]),b.jsxs("span",{className:"relative inline-flex",children:[b.jsx("span",{onMouseEnter:l,onMouseLeave:u,onFocus:l,onBlur:u,"aria-describedby":o?i:void 0,className:"inline-flex",children:t}),o?b.jsx("span",{id:i,role:"tooltip",className:`pointer-events-none absolute left-1/2 z-[var(--z-tooltip)] -translate-x-1/2 ${n==="top"?"bottom-full mb-1":"top-full mt-1"} whitespace-nowrap rounded-[var(--radius-sm)] border border-[var(--color-border-strong)] bg-[var(--gray-2)] px-2 py-1 text-[11px] text-[var(--color-text)] shadow-lg animate-fade-in`,children:e}):null]})}function KQ(){const{density:e,setDensity:t}=iF();return b.jsxs("div",{role:"group","aria-label":"Density",className:"inline-flex overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-3)]",children:[b.jsx(jg,{label:"Comfortable",children:b.jsx("button",{type:"button","aria-pressed":e==="comfortable",onClick:()=>t("comfortable"),className:e==="comfortable"?"flex h-7 w-7 items-center justify-center bg-[var(--gray-4)] text-[var(--color-text)]":"flex h-7 w-7 items-center justify-center text-[var(--color-text-dim)] hover:text-[var(--color-text)]",children:b.jsx(bQ,{size:12,"aria-hidden":!0})})}),b.jsx(jg,{label:"Compact",children:b.jsx("button",{type:"button","aria-pressed":e==="compact",onClick:()=>t("compact"),className:e==="compact"?"flex h-7 w-7 items-center justify-center bg-[var(--gray-4)] text-[var(--color-text)]":"flex h-7 w-7 items-center justify-center text-[var(--color-text-dim)] hover:text-[var(--color-text)]",children:b.jsx(xQ,{size:12,"aria-hidden":!0})})})]})}function GQ(){return b.jsxs("header",{className:"sticky top-0 z-[var(--z-sticky)] flex h-12 items-center justify-between gap-4 border-b border-[var(--color-border)] bg-[var(--color-bg)]/85 px-6 backdrop-blur-sm lg:px-8",children:[b.jsx(qQ,{}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("button",{type:"button","aria-label":"Open command palette (⌘K)",onClick:()=>{window.dispatchEvent(new CustomEvent("squad:cmdk:open"))},className:"hidden items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-3)] px-2.5 py-1 text-[12px] text-[var(--color-text-muted)] hover:border-[var(--color-border-strong)] hover:text-[var(--color-text)] sm:inline-flex",children:[b.jsx("span",{children:"Search…"}),b.jsx(Fi,{children:"⌘K"})]}),b.jsx(KQ,{}),b.jsx(Et,{tone:"success",dot:!0,children:"session"})]})]})}function QQ(){return BQ(),b.jsx("div",{className:"min-h-screen bg-[var(--color-bg)] text-[var(--color-text)]",children:b.jsxs("div",{className:"flex",children:[b.jsx(VQ,{}),b.jsxs("div",{className:"flex min-h-screen flex-1 flex-col",children:[b.jsx(GQ,{}),b.jsx("main",{className:"flex-1",children:b.jsx("div",{className:"mx-auto w-full max-w-screen-2xl px-6 py-6 lg:px-8",children:b.jsx(aB,{})})})]})]})})}const XQ={default:{fg:"var(--color-text)",bg:"var(--gray-2)",border:"var(--color-border)",icon:b.jsx(Rw,{size:14,className:"text-[var(--color-text-muted)]","aria-hidden":!0})},info:{fg:"var(--color-text)",bg:"var(--color-info-bg)",border:"var(--color-info-border)",icon:b.jsx(Rw,{size:14,className:"text-[var(--color-info)]","aria-hidden":!0})},success:{fg:"var(--color-text)",bg:"var(--color-ok-bg)",border:"var(--color-ok-border)",icon:b.jsx(GB,{size:14,className:"text-[var(--color-ok)]","aria-hidden":!0})},warning:{fg:"var(--color-text)",bg:"var(--color-warn-bg)",border:"var(--color-warn-border)",icon:b.jsx(tF,{size:14,className:"text-[var(--color-warn)]","aria-hidden":!0})},danger:{fg:"var(--color-text)",bg:"var(--color-fail-bg)",border:"var(--color-fail-border)",icon:b.jsx(KB,{size:14,className:"text-[var(--color-fail)]","aria-hidden":!0})}};function Ge({tone:e="default",title:t,icon:n,action:r,children:i,className:o=""}){const s=XQ[e];return b.jsxs("div",{role:e==="danger"||e==="warning"?"alert":"note",style:{background:s.bg,borderColor:s.border,color:s.fg},className:`flex gap-3 rounded-[var(--radius-md)] border px-3 py-2.5 text-sm ${o}`,children:[b.jsx("div",{className:"mt-0.5",children:n??s.icon}),b.jsxs("div",{className:"min-w-0 flex-1",children:[t?b.jsx("div",{className:"font-medium",children:t}):null,i?b.jsx("div",{className:`text-[13px] ${t?"mt-0.5 text-[var(--color-text-muted)]":""}`,children:i}):null]}),r?b.jsx("div",{className:"shrink-0",children:r}):null]})}const YQ={default:"bg-[var(--color-surface)] border border-[var(--color-border)]",flat:"bg-transparent border border-[var(--color-border)]",inset:"bg-[var(--gray-2)] border border-[var(--color-border)]"},nt=C.forwardRef(function({variant:t="default",interactive:n,header:r,footer:i,className:o="",children:s,...a},l){return b.jsxs("div",{ref:l,"data-interactive":n||void 0,className:`${YQ[t]} rounded-[var(--radius-md)] data-[interactive]:transition-colors data-[interactive]:hover:border-[var(--color-border-strong)] ${o}`,...a,children:[r?b.jsx("div",{className:"border-b border-[var(--color-border)] px-[var(--space-card)] py-3 text-sm font-medium text-[var(--color-text)]",children:r}):null,b.jsx("div",{className:"p-[var(--space-card)]",children:s}),i?b.jsx("div",{className:"border-t border-[var(--color-border)] px-[var(--space-card)] py-3 text-sm text-[var(--color-text-muted)]",children:i}):null]})});function Fe({title:e,description:t,actions:n,breadcrumbs:r,children:i}){return b.jsxs("section",{className:"flex flex-col",children:[r?b.jsx("div",{className:"mb-3",children:r}):null,b.jsxs("header",{className:"mb-6 flex flex-wrap items-start justify-between gap-4",children:[b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("h1",{className:"text-[var(--font-size-h1)] font-semibold tracking-tight text-[var(--color-text)]",style:{letterSpacing:"-0.015em"},children:e}),t?b.jsx("p",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:t}):null]}),n?b.jsx("div",{className:"flex shrink-0 items-center gap-2",children:n}):null]}),b.jsx("div",{className:"flex flex-col gap-[var(--space-section)]",children:i})]})}function aF(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=aF(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Se(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=aF(e))&&(r&&(r+=" "),r+=t);return r}var ZQ=Array.isArray,nr=ZQ,JQ=typeof Jo=="object"&&Jo&&Jo.Object===Object&&Jo,lF=JQ,eX=lF,tX=typeof self=="object"&&self&&self.Object===Object&&self,nX=eX||tX||Function("return this")(),Xi=nX,rX=Xi,iX=rX.Symbol,Kd=iX,s_=Kd,uF=Object.prototype,oX=uF.hasOwnProperty,sX=uF.toString,of=s_?s_.toStringTag:void 0;function aX(e){var t=oX.call(e,of),n=e[of];try{e[of]=void 0;var r=!0}catch{}var i=sX.call(e);return r&&(t?e[of]=n:delete e[of]),i}var lX=aX,uX=Object.prototype,cX=uX.toString;function fX(e){return cX.call(e)}var hX=fX,a_=Kd,dX=lX,pX=hX,mX="[object Null]",gX="[object Undefined]",l_=a_?a_.toStringTag:void 0;function yX(e){return e==null?e===void 0?gX:mX:l_&&l_ in Object(e)?dX(e):pX(e)}var Lo=yX;function vX(e){return e!=null&&typeof e=="object"}var $o=vX,bX=Lo,xX=$o,wX="[object Symbol]";function SX(e){return typeof e=="symbol"||xX(e)&&bX(e)==wX}var kc=SX,kX=nr,OX=kc,CX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,AX=/^\w*$/;function PX(e,t){if(kX(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||OX(e)?!0:AX.test(e)||!CX.test(e)||t!=null&&e in Object(t)}var FC=PX;function EX(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Bs=EX;const Oc=De(Bs);var TX=Lo,_X=Bs,MX="[object AsyncFunction]",IX="[object Function]",jX="[object GeneratorFunction]",RX="[object Proxy]";function NX(e){if(!_X(e))return!1;var t=TX(e);return t==IX||t==jX||t==MX||t==RX}var zC=NX;const xe=De(zC);var DX=Xi,LX=DX["__core-js_shared__"],$X=LX,tx=$X,u_=function(){var e=/[^.]+$/.exec(tx&&tx.keys&&tx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function BX(e){return!!u_&&u_ in e}var FX=BX,zX=Function.prototype,WX=zX.toString;function UX(e){if(e!=null){try{return WX.call(e)}catch{}try{return e+""}catch{}}return""}var cF=UX,HX=zC,VX=FX,qX=Bs,KX=cF,GX=/[\\^$.*+?()[\]{}|]/g,QX=/^\[object .+?Constructor\]$/,XX=Function.prototype,YX=Object.prototype,ZX=XX.toString,JX=YX.hasOwnProperty,eY=RegExp("^"+ZX.call(JX).replace(GX,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tY(e){if(!qX(e)||VX(e))return!1;var t=HX(e)?eY:QX;return t.test(KX(e))}var nY=tY;function rY(e,t){return e?.[t]}var iY=rY,oY=nY,sY=iY;function aY(e,t){var n=sY(e,t);return oY(n)?n:void 0}var ol=aY,lY=ol,uY=lY(Object,"create"),qv=uY,c_=qv;function cY(){this.__data__=c_?c_(null):{},this.size=0}var fY=cY;function hY(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var dY=hY,pY=qv,mY="__lodash_hash_undefined__",gY=Object.prototype,yY=gY.hasOwnProperty;function vY(e){var t=this.__data__;if(pY){var n=t[e];return n===mY?void 0:n}return yY.call(t,e)?t[e]:void 0}var bY=vY,xY=qv,wY=Object.prototype,SY=wY.hasOwnProperty;function kY(e){var t=this.__data__;return xY?t[e]!==void 0:SY.call(t,e)}var OY=kY,CY=qv,AY="__lodash_hash_undefined__";function PY(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=CY&&t===void 0?AY:t,this}var EY=PY,TY=fY,_Y=dY,MY=bY,IY=OY,jY=EY;function Cc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cc.prototype.clear=TY;Cc.prototype.delete=_Y;Cc.prototype.get=MY;Cc.prototype.has=IY;Cc.prototype.set=jY;var RY=Cc;function NY(){this.__data__=[],this.size=0}var DY=NY;function LY(e,t){return e===t||e!==e&&t!==t}var WC=LY,$Y=WC;function BY(e,t){for(var n=e.length;n--;)if($Y(e[n][0],t))return n;return-1}var Kv=BY,FY=Kv,zY=Array.prototype,WY=zY.splice;function UY(e){var t=this.__data__,n=FY(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():WY.call(t,n,1),--this.size,!0}var HY=UY,VY=Kv;function qY(e){var t=this.__data__,n=VY(t,e);return n<0?void 0:t[n][1]}var KY=qY,GY=Kv;function QY(e){return GY(this.__data__,e)>-1}var XY=QY,YY=Kv;function ZY(e,t){var n=this.__data__,r=YY(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var JY=ZY,eZ=DY,tZ=HY,nZ=KY,rZ=XY,iZ=JY;function Ac(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ac.prototype.clear=eZ;Ac.prototype.delete=tZ;Ac.prototype.get=nZ;Ac.prototype.has=rZ;Ac.prototype.set=iZ;var Gv=Ac,oZ=ol,sZ=Xi,aZ=oZ(sZ,"Map"),UC=aZ,f_=RY,lZ=Gv,uZ=UC;function cZ(){this.size=0,this.__data__={hash:new f_,map:new(uZ||lZ),string:new f_}}var fZ=cZ;function hZ(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var dZ=hZ,pZ=dZ;function mZ(e,t){var n=e.__data__;return pZ(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Qv=mZ,gZ=Qv;function yZ(e){var t=gZ(this,e).delete(e);return this.size-=t?1:0,t}var vZ=yZ,bZ=Qv;function xZ(e){return bZ(this,e).get(e)}var wZ=xZ,SZ=Qv;function kZ(e){return SZ(this,e).has(e)}var OZ=kZ,CZ=Qv;function AZ(e,t){var n=CZ(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var PZ=AZ,EZ=fZ,TZ=vZ,_Z=wZ,MZ=OZ,IZ=PZ;function Pc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pc.prototype.clear=EZ;Pc.prototype.delete=TZ;Pc.prototype.get=_Z;Pc.prototype.has=MZ;Pc.prototype.set=IZ;var HC=Pc,fF=HC,jZ="Expected a function";function VC(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(jZ);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(VC.Cache||fF),n}VC.Cache=fF;var hF=VC;const RZ=De(hF);var NZ=hF,DZ=500;function LZ(e){var t=NZ(e,function(r){return n.size===DZ&&n.clear(),r}),n=t.cache;return t}var $Z=LZ,BZ=$Z,FZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zZ=/\\(\\)?/g,WZ=BZ(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(FZ,function(n,r,i,o){t.push(i?o.replace(zZ,"$1"):r||n)}),t}),UZ=WZ;function HZ(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var qC=HZ,h_=Kd,VZ=qC,qZ=nr,KZ=kc,d_=h_?h_.prototype:void 0,p_=d_?d_.toString:void 0;function dF(e){if(typeof e=="string")return e;if(qZ(e))return VZ(e,dF)+"";if(KZ(e))return p_?p_.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var GZ=dF,QZ=GZ;function XZ(e){return e==null?"":QZ(e)}var pF=XZ,YZ=nr,ZZ=FC,JZ=UZ,eJ=pF;function tJ(e,t){return YZ(e)?e:ZZ(e,t)?[e]:JZ(eJ(e))}var mF=tJ,nJ=kc;function rJ(e){if(typeof e=="string"||nJ(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Xv=rJ,iJ=mF,oJ=Xv;function sJ(e,t){t=iJ(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[oJ(t[n++])];return n&&n==r?e:void 0}var KC=sJ,aJ=KC;function lJ(e,t,n){var r=e==null?void 0:aJ(e,t);return r===void 0?n:r}var gF=lJ;const Sr=De(gF);function uJ(e){return e==null}var cJ=uJ;const we=De(cJ);var fJ=Lo,hJ=nr,dJ=$o,pJ="[object String]";function mJ(e){return typeof e=="string"||!hJ(e)&&dJ(e)&&fJ(e)==pJ}var gJ=mJ;const Va=De(gJ);var yF={exports:{}},We={};/**
261
+ * @license React
262
+ * react-is.production.min.js
263
+ *
264
+ * Copyright (c) Facebook, Inc. and its affiliates.
265
+ *
266
+ * This source code is licensed under the MIT license found in the
267
+ * LICENSE file in the root directory of this source tree.
268
+ */var GC=Symbol.for("react.element"),QC=Symbol.for("react.portal"),Yv=Symbol.for("react.fragment"),Zv=Symbol.for("react.strict_mode"),Jv=Symbol.for("react.profiler"),e0=Symbol.for("react.provider"),t0=Symbol.for("react.context"),yJ=Symbol.for("react.server_context"),n0=Symbol.for("react.forward_ref"),r0=Symbol.for("react.suspense"),i0=Symbol.for("react.suspense_list"),o0=Symbol.for("react.memo"),s0=Symbol.for("react.lazy"),vJ=Symbol.for("react.offscreen"),vF;vF=Symbol.for("react.module.reference");function Gr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case GC:switch(e=e.type,e){case Yv:case Jv:case Zv:case r0:case i0:return e;default:switch(e=e&&e.$$typeof,e){case yJ:case t0:case n0:case s0:case o0:case e0:return e;default:return t}}case QC:return t}}}We.ContextConsumer=t0;We.ContextProvider=e0;We.Element=GC;We.ForwardRef=n0;We.Fragment=Yv;We.Lazy=s0;We.Memo=o0;We.Portal=QC;We.Profiler=Jv;We.StrictMode=Zv;We.Suspense=r0;We.SuspenseList=i0;We.isAsyncMode=function(){return!1};We.isConcurrentMode=function(){return!1};We.isContextConsumer=function(e){return Gr(e)===t0};We.isContextProvider=function(e){return Gr(e)===e0};We.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===GC};We.isForwardRef=function(e){return Gr(e)===n0};We.isFragment=function(e){return Gr(e)===Yv};We.isLazy=function(e){return Gr(e)===s0};We.isMemo=function(e){return Gr(e)===o0};We.isPortal=function(e){return Gr(e)===QC};We.isProfiler=function(e){return Gr(e)===Jv};We.isStrictMode=function(e){return Gr(e)===Zv};We.isSuspense=function(e){return Gr(e)===r0};We.isSuspenseList=function(e){return Gr(e)===i0};We.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yv||e===Jv||e===Zv||e===r0||e===i0||e===vJ||typeof e=="object"&&e!==null&&(e.$$typeof===s0||e.$$typeof===o0||e.$$typeof===e0||e.$$typeof===t0||e.$$typeof===n0||e.$$typeof===vF||e.getModuleId!==void 0)};We.typeOf=Gr;yF.exports=We;var bJ=yF.exports,xJ=Lo,wJ=$o,SJ="[object Number]";function kJ(e){return typeof e=="number"||wJ(e)&&xJ(e)==SJ}var bF=kJ;const OJ=De(bF);var CJ=bF;function AJ(e){return CJ(e)&&e!=+e}var PJ=AJ;const Gd=De(PJ);var Mn=function(t){return t===0?0:t>0?1:-1},ya=function(t){return Va(t)&&t.indexOf("%")===t.length-1},ne=function(t){return OJ(t)&&!Gd(t)},EJ=function(t){return we(t)},Ht=function(t){return ne(t)||Va(t)},TJ=0,Ec=function(t){var n=++TJ;return"".concat(t||"").concat(n)},In=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ne(t)&&!Va(t))return r;var o;if(ya(t)){var s=t.indexOf("%");o=n*parseFloat(t.slice(0,s))/100}else o=+t;return Gd(o)&&(o=r),i&&o>n&&(o=n),o},Tl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},_J=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},gr=function(t,n){return ne(t)&&ne(n)?function(r){return t+r*(n-t)}:function(){return n}};function Rg(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Sr(r,t))===n})}var MJ=function(t,n){return ne(t)&&ne(n)?t-n:Va(t)&&Va(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function hu(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function Nw(e){"@babel/helpers - typeof";return Nw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nw(e)}var IJ=["viewBox","children"],jJ=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],m_=["points","pathLength"],nx={svg:IJ,polygon:m_,polyline:m_},XC=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Ng=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(C.isValidElement(t)&&(r=t.props),!Oc(r))return null;var i={};return Object.keys(r).forEach(function(o){XC.includes(o)&&(i[o]=n||function(s){return r[o](r,s)})}),i},RJ=function(t,n,r){return function(i){return t(n,r,i),null}},qa=function(t,n,r){if(!Oc(t)||Nw(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(o){var s=t[o];XC.includes(o)&&typeof s=="function"&&(i||(i={}),i[o]=RJ(s,n,r))}),i},NJ=["children"],DJ=["children"];function g_(e,t){if(e==null)return{};var n=LJ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Dw(e){"@babel/helpers - typeof";return Dw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dw(e)}var y_={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},yo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},v_=null,rx=null,YC=function e(t){if(t===v_&&Array.isArray(rx))return rx;var n=[];return C.Children.forEach(t,function(r){we(r)||(bJ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),rx=n,v_=t,n};function kr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return yo(i)}):r=[yo(t)],YC(e).forEach(function(i){var o=Sr(i,"type.displayName")||Sr(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function dr(e,t){var n=kr(e,t);return n&&n[0]}var b_=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ne(r)||r<=0||!ne(i)||i<=0)},$J=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],BJ=function(t){return t&&t.type&&Va(t.type)&&$J.indexOf(t.type)>=0},FJ=function(t){return t&&Dw(t)==="object"&&"clipDot"in t},zJ=function(t,n,r,i){var o,s=(o=nx?.[i])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!xe(t)&&(i&&s.includes(n)||jJ.includes(n))||r&&XC.includes(n)},de=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(C.isValidElement(t)&&(i=t.props),!Oc(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;zJ((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},Lw=function e(t,n){if(t===n)return!0;var r=C.Children.count(t);if(r!==C.Children.count(n))return!1;if(r===0)return!0;if(r===1)return x_(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=t[i],s=n[i];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!x_(o,s))return!1}return!0},x_=function(t,n){if(we(t)&&we(n))return!0;if(!we(t)&&!we(n)){var r=t.props||{},i=r.children,o=g_(r,NJ),s=n.props||{},a=s.children,l=g_(s,DJ);return i&&a?hu(o,l)&&Lw(i,a):!i&&!a?hu(o,l):!1}return!1},w_=function(t,n){var r=[],i={};return YC(t).forEach(function(o,s){if(BJ(o))r.push(o);else if(o){var a=yo(o.type),l=n[a]||{},u=l.handler,c=l.once;if(u&&(!c||!i[a])){var f=u(o,a,s);r.push(f),i[a]=!0}}}),r},WJ=function(t){var n=t&&t.type;return n&&y_[n]?y_[n]:null},UJ=function(t,n){return YC(n).indexOf(t)},HJ=["children","width","height","viewBox","className","style","title","desc"];function $w(){return $w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$w.apply(this,arguments)}function VJ(e,t){if(e==null)return{};var n=qJ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bw(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,o=e.className,s=e.style,a=e.title,l=e.desc,u=VJ(e,HJ),c=i||{width:n,height:r,x:0,y:0},f=Se("recharts-surface",o);return L.createElement("svg",$w({},de(u,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),L.createElement("title",null,a),L.createElement("desc",null,l),t)}var KJ=["children","className"];function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fw.apply(this,arguments)}function GJ(e,t){if(e==null)return{};var n=QJ(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var je=L.forwardRef(function(e,t){var n=e.children,r=e.className,i=GJ(e,KJ),o=Se("recharts-layer",r);return L.createElement("g",Fw({className:o},de(i,!0),{ref:t}),n)}),vo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o]};function XJ(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var YJ=XJ,ZJ=YJ;function JJ(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:ZJ(e,t,n)}var eee=JJ,tee="\\ud800-\\udfff",nee="\\u0300-\\u036f",ree="\\ufe20-\\ufe2f",iee="\\u20d0-\\u20ff",oee=nee+ree+iee,see="\\ufe0e\\ufe0f",aee="\\u200d",lee=RegExp("["+aee+tee+oee+see+"]");function uee(e){return lee.test(e)}var xF=uee;function cee(e){return e.split("")}var fee=cee,wF="\\ud800-\\udfff",hee="\\u0300-\\u036f",dee="\\ufe20-\\ufe2f",pee="\\u20d0-\\u20ff",mee=hee+dee+pee,gee="\\ufe0e\\ufe0f",yee="["+wF+"]",zw="["+mee+"]",Ww="\\ud83c[\\udffb-\\udfff]",vee="(?:"+zw+"|"+Ww+")",SF="[^"+wF+"]",kF="(?:\\ud83c[\\udde6-\\uddff]){2}",OF="[\\ud800-\\udbff][\\udc00-\\udfff]",bee="\\u200d",CF=vee+"?",AF="["+gee+"]?",xee="(?:"+bee+"(?:"+[SF,kF,OF].join("|")+")"+AF+CF+")*",wee=AF+CF+xee,See="(?:"+[SF+zw+"?",zw,kF,OF,yee].join("|")+")",kee=RegExp(Ww+"(?="+Ww+")|"+See+wee,"g");function Oee(e){return e.match(kee)||[]}var Cee=Oee,Aee=fee,Pee=xF,Eee=Cee;function Tee(e){return Pee(e)?Eee(e):Aee(e)}var _ee=Tee,Mee=eee,Iee=xF,jee=_ee,Ree=pF;function Nee(e){return function(t){t=Ree(t);var n=Iee(t)?jee(t):void 0,r=n?n[0]:t.charAt(0),i=n?Mee(n,1).join(""):t.slice(1);return r[e]()+i}}var Dee=Nee,Lee=Dee,$ee=Lee("toUpperCase"),Bee=$ee;const a0=De(Bee);function et(e){return function(){return e}}const PF=Math.cos,Dg=Math.sin,yi=Math.sqrt,Lg=Math.PI,l0=2*Lg,Uw=Math.PI,Hw=2*Uw,na=1e-6,Fee=Hw-na;function EF(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zee(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return EF;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Wee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?EF:zee(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,u=i-n,c=s-t,f=a-n,h=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>na)if(!(Math.abs(f*l-u*c)>na)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let d=r-s,p=i-a,m=l*l+u*u,y=d*d+p*p,g=Math.sqrt(m),v=Math.sqrt(h),x=o*Math.tan((Uw-Math.acos((m+h-y)/(2*g*v)))/2),k=x/v,w=x/g;Math.abs(k-1)>na&&this._append`L${t+k*c},${n+k*f}`,this._append`A${o},${o},0,0,${+(f*d>c*p)},${this._x1=t+w*l},${this._y1=n+w*u}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),u=t+a,c=n+l,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>na||Math.abs(this._y1-c)>na)&&this._append`L${u},${c}`,r&&(h<0&&(h=h%Hw+Hw),h>Fee?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=c}`:h>na&&this._append`A${r},${r},0,${+(h>=Uw)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function ZC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Wee(t)}function JC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TF(e){this._context=e}TF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function u0(e){return new TF(e)}function _F(e){return e[0]}function MF(e){return e[1]}function IF(e,t){var n=et(!0),r=null,i=u0,o=null,s=ZC(a);e=typeof e=="function"?e:e===void 0?_F:et(e),t=typeof t=="function"?t:t===void 0?MF:et(t);function a(l){var u,c=(l=JC(l)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),u=0;u<=c;++u)!(u<c&&n(f=l[u],u,l))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(f,u,l),+t(f,u,l));if(d)return o=null,d+""||null}return a.x=function(l){return arguments.length?(e=typeof l=="function"?l:et(+l),a):e},a.y=function(l){return arguments.length?(t=typeof l=="function"?l:et(+l),a):t},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:et(!!l),a):n},a.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),a):i},a.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),a):r},a}function Dp(e,t,n){var r=null,i=et(!0),o=null,s=u0,a=null,l=ZC(u);e=typeof e=="function"?e:e===void 0?_F:et(+e),t=typeof t=="function"?t:et(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?MF:et(+n);function u(f){var h,d,p,m=(f=JC(f)).length,y,g=!1,v,x=new Array(m),k=new Array(m);for(o==null&&(a=s(v=l())),h=0;h<=m;++h){if(!(h<m&&i(y=f[h],h,f))===g)if(g=!g)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=h-1;p>=d;--p)a.point(x[p],k[p]);a.lineEnd(),a.areaEnd()}g&&(x[h]=+e(y,h,f),k[h]=+t(y,h,f),a.point(r?+r(y,h,f):x[h],n?+n(y,h,f):k[h]))}if(v)return a=null,v+""||null}function c(){return IF().defined(i).curve(s).context(o)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:et(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:et(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:et(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:et(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:et(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:et(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:et(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),u):s},u.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),u):o},u}class jF{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Uee(e){return new jF(e,!0)}function Hee(e){return new jF(e,!1)}const eA={draw(e,t){const n=yi(t/Lg);e.moveTo(n,0),e.arc(0,0,n,0,l0)}},Vee={draw(e,t){const n=yi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},RF=yi(1/3),qee=RF*2,Kee={draw(e,t){const n=yi(t/qee),r=n*RF;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Gee={draw(e,t){const n=yi(t),r=-n/2;e.rect(r,r,n,n)}},Qee=.8908130915292852,NF=Dg(Lg/10)/Dg(7*Lg/10),Xee=Dg(l0/10)*NF,Yee=-PF(l0/10)*NF,Zee={draw(e,t){const n=yi(t*Qee),r=Xee*n,i=Yee*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const s=l0*o/5,a=PF(s),l=Dg(s);e.lineTo(l*n,-a*n),e.lineTo(a*r-l*i,l*r+a*i)}e.closePath()}},ix=yi(3),Jee={draw(e,t){const n=-yi(t/(ix*3));e.moveTo(0,n*2),e.lineTo(-ix*n,-n),e.lineTo(ix*n,-n),e.closePath()}},Tr=-.5,_r=yi(3)/2,Vw=1/yi(12),ete=(Vw/2+1)*3,tte={draw(e,t){const n=yi(t/ete),r=n/2,i=n*Vw,o=r,s=n*Vw+n,a=-o,l=s;e.moveTo(r,i),e.lineTo(o,s),e.lineTo(a,l),e.lineTo(Tr*r-_r*i,_r*r+Tr*i),e.lineTo(Tr*o-_r*s,_r*o+Tr*s),e.lineTo(Tr*a-_r*l,_r*a+Tr*l),e.lineTo(Tr*r+_r*i,Tr*i-_r*r),e.lineTo(Tr*o+_r*s,Tr*s-_r*o),e.lineTo(Tr*a+_r*l,Tr*l-_r*a),e.closePath()}};function nte(e,t){let n=null,r=ZC(i);e=typeof e=="function"?e:et(e||eA),t=typeof t=="function"?t:et(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:et(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:et(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function $g(){}function Bg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function DF(e){this._context=e}DF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rte(e){return new DF(e)}function LF(e){this._context=e}LF.prototype={areaStart:$g,areaEnd:$g,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Bg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ite(e){return new LF(e)}function $F(e){this._context=e}$F.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Bg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ote(e){return new $F(e)}function BF(e){this._context=e}BF.prototype={areaStart:$g,areaEnd:$g,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ste(e){return new BF(e)}function S_(e){return e<0?-1:1}function k_(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(S_(o)+S_(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function O_(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ox(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function Fg(e){this._context=e}Fg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ox(this,this._t0,O_(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ox(this,O_(this,n=k_(this,e,t)),n);break;default:ox(this,this._t0,n=k_(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function FF(e){this._context=new zF(e)}(FF.prototype=Object.create(Fg.prototype)).point=function(e,t){Fg.prototype.point.call(this,t,e)};function zF(e){this._context=e}zF.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function ate(e){return new Fg(e)}function lte(e){return new FF(e)}function WF(e){this._context=e}WF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=C_(e),i=C_(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function C_(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function ute(e){return new WF(e)}function c0(e,t){this._context=e,this._t=t}c0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function cte(e){return new c0(e,.5)}function fte(e){return new c0(e,0)}function hte(e){return new c0(e,1)}function Nu(e,t){if((s=e.length)>1)for(var n=1,r,i,o=e[t[0]],s,a=o.length;n<s;++n)for(i=o,o=e[t[n]],r=0;r<a;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function qw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dte(e,t){return e[t]}function pte(e){const t=[];return t.key=e,t}function mte(){var e=et([]),t=qw,n=Nu,r=dte;function i(o){var s=Array.from(e.apply(this,arguments),pte),a,l=s.length,u=-1,c;for(const f of o)for(a=0,++u;a<l;++a)(s[a][u]=[0,+r(f,s[a].key,u,o)]).data=f;for(a=0,c=JC(t(s));a<l;++a)s[c[a]].index=a;return n(s,c),s}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:et(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:et(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?qw:typeof o=="function"?o:et(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Nu,i):n},i}function gte(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,s;i<o;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Nu(e,t)}}function yte(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var s=0,a=0;s<i;++s)a+=e[s][n][1]||0;r[n][1]+=r[n][0]=-a/2}Nu(e,t)}}function vte(e,t){if(!(!((s=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,s;r<o;++r){for(var a=0,l=0,u=0;a<s;++a){for(var c=e[t[a]],f=c[r][1]||0,h=c[r-1][1]||0,d=(f-h)/2,p=0;p<a;++p){var m=e[t[p]],y=m[r][1]||0,g=m[r-1][1]||0;d+=y-g}l+=f,u+=d*f}i[r-1][1]+=i[r-1][0]=n,l&&(n-=u/l)}i[r-1][1]+=i[r-1][0]=n,Nu(e,t)}}function Dh(e){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(e)}var bte=["type","size","sizeType"];function Kw(){return Kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kw.apply(this,arguments)}function A_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function P_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A_(Object(n),!0).forEach(function(r){xte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xte(e,t,n){return t=wte(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wte(e){var t=Ste(e,"string");return Dh(t)=="symbol"?t:t+""}function Ste(e,t){if(Dh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kte(e,t){if(e==null)return{};var n=Ote(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ote(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var UF={symbolCircle:eA,symbolCross:Vee,symbolDiamond:Kee,symbolSquare:Gee,symbolStar:Zee,symbolTriangle:Jee,symbolWye:tte},Cte=Math.PI/180,Ate=function(t){var n="symbol".concat(a0(t));return UF[n]||eA},Pte=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Cte;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Ete=function(t,n){UF["symbol".concat(a0(t))]=n},tA=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,o=i===void 0?64:i,s=t.sizeType,a=s===void 0?"area":s,l=kte(t,bte),u=P_(P_({},l),{},{type:r,size:o,sizeType:a}),c=function(){var y=Ate(r),g=nte().type(y).size(Pte(o,a,r));return g()},f=u.className,h=u.cx,d=u.cy,p=de(u,!0);return h===+h&&d===+d&&o===+o?L.createElement("path",Kw({},p,{className:Se("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};tA.registerSymbol=Ete;function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}function Gw(){return Gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gw.apply(this,arguments)}function E_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E_(Object(n),!0).forEach(function(r){Lh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mte(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,VF(r.key),r)}}function Ite(e,t,n){return t&&Mte(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jte(e,t,n){return t=zg(t),Rte(e,HF()?Reflect.construct(t,n||[],zg(e).constructor):t.apply(e,n))}function Rte(e,t){if(t&&(Du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nte(e)}function Nte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HF=function(){return!!e})()}function zg(e){return zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zg(e)}function Dte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qw(e,t)}function Qw(e,t){return Qw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Qw(e,t)}function Lh(e,t,n){return t=VF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VF(e){var t=Lte(e,"string");return Du(t)=="symbol"?t:t+""}function Lte(e,t){if(Du(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Du(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Mr=32,nA=function(e){function t(){return _te(this,t),jte(this,t,arguments)}return Dte(t,e),Ite(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=Mr/2,s=Mr/6,a=Mr/3,l=r.inactive?i:r.color;if(r.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Mr,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(o,"h").concat(a,`
269
+ A`).concat(s,",").concat(s,",0,1,1,").concat(2*a,",").concat(o,`
270
+ H`).concat(Mr,"M").concat(2*a,",").concat(o,`
271
+ A`).concat(s,",").concat(s,",0,1,1,").concat(a,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return L.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Mr/8,"h").concat(Mr,"v").concat(Mr*3/4,"h").concat(-Mr,"z"),className:"recharts-legend-icon"});if(L.isValidElement(r.legendIcon)){var u=Tte({},r);return delete u.legendIcon,L.cloneElement(r.legendIcon,u)}return L.createElement(tA,{fill:l,cx:o,cy:o,size:Mr,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,s=i.iconSize,a=i.layout,l=i.formatter,u=i.inactiveColor,c={x:0,y:0,width:Mr,height:Mr},f={display:a==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(d,p){var m=d.formatter||l,y=Se(Lh(Lh({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",d.inactive));if(d.type==="none")return null;var g=xe(d.value)?null:d.value;vo(!xe(d.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var v=d.inactive?u:d.color;return L.createElement("li",Gw({className:y,style:f,key:"legend-item-".concat(p)},qa(r.props,d,p)),L.createElement(Bw,{width:s,height:s,viewBox:c,style:h},r.renderIcon(d)),L.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},m?m(g,d,p):g))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return L.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}])}(C.PureComponent);Lh(nA,"displayName","Legend");Lh(nA,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var $te=Gv;function Bte(){this.__data__=new $te,this.size=0}var Fte=Bte;function zte(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Wte=zte;function Ute(e){return this.__data__.get(e)}var Hte=Ute;function Vte(e){return this.__data__.has(e)}var qte=Vte,Kte=Gv,Gte=UC,Qte=HC,Xte=200;function Yte(e,t){var n=this.__data__;if(n instanceof Kte){var r=n.__data__;if(!Gte||r.length<Xte-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Qte(r)}return n.set(e,t),this.size=n.size,this}var Zte=Yte,Jte=Gv,ene=Fte,tne=Wte,nne=Hte,rne=qte,ine=Zte;function Tc(e){var t=this.__data__=new Jte(e);this.size=t.size}Tc.prototype.clear=ene;Tc.prototype.delete=tne;Tc.prototype.get=nne;Tc.prototype.has=rne;Tc.prototype.set=ine;var qF=Tc,one="__lodash_hash_undefined__";function sne(e){return this.__data__.set(e,one),this}var ane=sne;function lne(e){return this.__data__.has(e)}var une=lne,cne=HC,fne=ane,hne=une;function Wg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new cne;++t<n;)this.add(e[t])}Wg.prototype.add=Wg.prototype.push=fne;Wg.prototype.has=hne;var KF=Wg;function dne(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var GF=dne;function pne(e,t){return e.has(t)}var QF=pne,mne=KF,gne=GF,yne=QF,vne=1,bne=2;function xne(e,t,n,r,i,o){var s=n&vne,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var f=-1,h=!0,d=n&bne?new mne:void 0;for(o.set(e,t),o.set(t,e);++f<a;){var p=e[f],m=t[f];if(r)var y=s?r(m,p,f,t,e,o):r(p,m,f,e,t,o);if(y!==void 0){if(y)continue;h=!1;break}if(d){if(!gne(t,function(g,v){if(!yne(d,v)&&(p===g||i(p,g,n,r,o)))return d.push(v)})){h=!1;break}}else if(!(p===m||i(p,m,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h}var XF=xne,wne=Xi,Sne=wne.Uint8Array,kne=Sne;function One(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var Cne=One;function Ane(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var rA=Ane,T_=Kd,__=kne,Pne=WC,Ene=XF,Tne=Cne,_ne=rA,Mne=1,Ine=2,jne="[object Boolean]",Rne="[object Date]",Nne="[object Error]",Dne="[object Map]",Lne="[object Number]",$ne="[object RegExp]",Bne="[object Set]",Fne="[object String]",zne="[object Symbol]",Wne="[object ArrayBuffer]",Une="[object DataView]",M_=T_?T_.prototype:void 0,sx=M_?M_.valueOf:void 0;function Hne(e,t,n,r,i,o,s){switch(n){case Une:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Wne:return!(e.byteLength!=t.byteLength||!o(new __(e),new __(t)));case jne:case Rne:case Lne:return Pne(+e,+t);case Nne:return e.name==t.name&&e.message==t.message;case $ne:case Fne:return e==t+"";case Dne:var a=Tne;case Bne:var l=r&Mne;if(a||(a=_ne),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=Ine,s.set(e,t);var c=Ene(a(e),a(t),r,i,o,s);return s.delete(e),c;case zne:if(sx)return sx.call(e)==sx.call(t)}return!1}var Vne=Hne;function qne(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var YF=qne,Kne=YF,Gne=nr;function Qne(e,t,n){var r=t(e);return Gne(e)?r:Kne(r,n(e))}var Xne=Qne;function Yne(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var Zne=Yne;function Jne(){return[]}var ere=Jne,tre=Zne,nre=ere,rre=Object.prototype,ire=rre.propertyIsEnumerable,I_=Object.getOwnPropertySymbols,ore=I_?function(e){return e==null?[]:(e=Object(e),tre(I_(e),function(t){return ire.call(e,t)}))}:nre,sre=ore;function are(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var lre=are,ure=Lo,cre=$o,fre="[object Arguments]";function hre(e){return cre(e)&&ure(e)==fre}var dre=hre,j_=dre,pre=$o,ZF=Object.prototype,mre=ZF.hasOwnProperty,gre=ZF.propertyIsEnumerable,yre=j_(function(){return arguments}())?j_:function(e){return pre(e)&&mre.call(e,"callee")&&!gre.call(e,"callee")},iA=yre,Ug={exports:{}};function vre(){return!1}var bre=vre;Ug.exports;(function(e,t){var n=Xi,r=bre,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;e.exports=u})(Ug,Ug.exports);var JF=Ug.exports,xre=9007199254740991,wre=/^(?:0|[1-9]\d*)$/;function Sre(e,t){var n=typeof e;return t=t??xre,!!t&&(n=="number"||n!="symbol"&&wre.test(e))&&e>-1&&e%1==0&&e<t}var oA=Sre,kre=9007199254740991;function Ore(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kre}var sA=Ore,Cre=Lo,Are=sA,Pre=$o,Ere="[object Arguments]",Tre="[object Array]",_re="[object Boolean]",Mre="[object Date]",Ire="[object Error]",jre="[object Function]",Rre="[object Map]",Nre="[object Number]",Dre="[object Object]",Lre="[object RegExp]",$re="[object Set]",Bre="[object String]",Fre="[object WeakMap]",zre="[object ArrayBuffer]",Wre="[object DataView]",Ure="[object Float32Array]",Hre="[object Float64Array]",Vre="[object Int8Array]",qre="[object Int16Array]",Kre="[object Int32Array]",Gre="[object Uint8Array]",Qre="[object Uint8ClampedArray]",Xre="[object Uint16Array]",Yre="[object Uint32Array]",lt={};lt[Ure]=lt[Hre]=lt[Vre]=lt[qre]=lt[Kre]=lt[Gre]=lt[Qre]=lt[Xre]=lt[Yre]=!0;lt[Ere]=lt[Tre]=lt[zre]=lt[_re]=lt[Wre]=lt[Mre]=lt[Ire]=lt[jre]=lt[Rre]=lt[Nre]=lt[Dre]=lt[Lre]=lt[$re]=lt[Bre]=lt[Fre]=!1;function Zre(e){return Pre(e)&&Are(e.length)&&!!lt[Cre(e)]}var Jre=Zre;function eie(e){return function(t){return e(t)}}var e3=eie,Hg={exports:{}};Hg.exports;(function(e,t){var n=lF,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a})(Hg,Hg.exports);var tie=Hg.exports,nie=Jre,rie=e3,R_=tie,N_=R_&&R_.isTypedArray,iie=N_?rie(N_):nie,t3=iie,oie=lre,sie=iA,aie=nr,lie=JF,uie=oA,cie=t3,fie=Object.prototype,hie=fie.hasOwnProperty;function die(e,t){var n=aie(e),r=!n&&sie(e),i=!n&&!r&&lie(e),o=!n&&!r&&!i&&cie(e),s=n||r||i||o,a=s?oie(e.length,String):[],l=a.length;for(var u in e)(t||hie.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||uie(u,l)))&&a.push(u);return a}var pie=die,mie=Object.prototype;function gie(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||mie;return e===n}var yie=gie;function vie(e,t){return function(n){return e(t(n))}}var n3=vie,bie=n3,xie=bie(Object.keys,Object),wie=xie,Sie=yie,kie=wie,Oie=Object.prototype,Cie=Oie.hasOwnProperty;function Aie(e){if(!Sie(e))return kie(e);var t=[];for(var n in Object(e))Cie.call(e,n)&&n!="constructor"&&t.push(n);return t}var Pie=Aie,Eie=zC,Tie=sA;function _ie(e){return e!=null&&Tie(e.length)&&!Eie(e)}var f0=_ie,Mie=pie,Iie=Pie,jie=f0;function Rie(e){return jie(e)?Mie(e):Iie(e)}var aA=Rie,Nie=Xne,Die=sre,Lie=aA;function $ie(e){return Nie(e,Lie,Die)}var Bie=$ie,D_=Bie,Fie=1,zie=Object.prototype,Wie=zie.hasOwnProperty;function Uie(e,t,n,r,i,o){var s=n&Fie,a=D_(e),l=a.length,u=D_(t),c=u.length;if(l!=c&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in t:Wie.call(t,h)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var y=s;++f<l;){h=a[f];var g=e[h],v=t[h];if(r)var x=s?r(v,g,h,t,e,o):r(g,v,h,e,t,o);if(!(x===void 0?g===v||i(g,v,n,r,o):x)){m=!1;break}y||(y=h=="constructor")}if(m&&!y){var k=e.constructor,w=t.constructor;k!=w&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof w=="function"&&w instanceof w)&&(m=!1)}return o.delete(e),o.delete(t),m}var Hie=Uie,Vie=ol,qie=Xi,Kie=Vie(qie,"DataView"),Gie=Kie,Qie=ol,Xie=Xi,Yie=Qie(Xie,"Promise"),Zie=Yie,Jie=ol,eoe=Xi,toe=Jie(eoe,"Set"),r3=toe,noe=ol,roe=Xi,ioe=noe(roe,"WeakMap"),ooe=ioe,Xw=Gie,Yw=UC,Zw=Zie,Jw=r3,eS=ooe,i3=Lo,_c=cF,L_="[object Map]",soe="[object Object]",$_="[object Promise]",B_="[object Set]",F_="[object WeakMap]",z_="[object DataView]",aoe=_c(Xw),loe=_c(Yw),uoe=_c(Zw),coe=_c(Jw),foe=_c(eS),ra=i3;(Xw&&ra(new Xw(new ArrayBuffer(1)))!=z_||Yw&&ra(new Yw)!=L_||Zw&&ra(Zw.resolve())!=$_||Jw&&ra(new Jw)!=B_||eS&&ra(new eS)!=F_)&&(ra=function(e){var t=i3(e),n=t==soe?e.constructor:void 0,r=n?_c(n):"";if(r)switch(r){case aoe:return z_;case loe:return L_;case uoe:return $_;case coe:return B_;case foe:return F_}return t});var hoe=ra,ax=qF,doe=XF,poe=Vne,moe=Hie,W_=hoe,U_=nr,H_=JF,goe=t3,yoe=1,V_="[object Arguments]",q_="[object Array]",Lp="[object Object]",voe=Object.prototype,K_=voe.hasOwnProperty;function boe(e,t,n,r,i,o){var s=U_(e),a=U_(t),l=s?q_:W_(e),u=a?q_:W_(t);l=l==V_?Lp:l,u=u==V_?Lp:u;var c=l==Lp,f=u==Lp,h=l==u;if(h&&H_(e)){if(!H_(t))return!1;s=!0,c=!1}if(h&&!c)return o||(o=new ax),s||goe(e)?doe(e,t,n,r,i,o):poe(e,t,l,n,r,i,o);if(!(n&yoe)){var d=c&&K_.call(e,"__wrapped__"),p=f&&K_.call(t,"__wrapped__");if(d||p){var m=d?e.value():e,y=p?t.value():t;return o||(o=new ax),i(m,y,n,r,o)}}return h?(o||(o=new ax),moe(e,t,n,r,i,o)):!1}var xoe=boe,woe=xoe,G_=$o;function o3(e,t,n,r,i){return e===t?!0:e==null||t==null||!G_(e)&&!G_(t)?e!==e&&t!==t:woe(e,t,n,r,o3,i)}var lA=o3,Soe=qF,koe=lA,Ooe=1,Coe=2;function Aoe(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],u=e[l],c=a[1];if(s&&a[2]){if(u===void 0&&!(l in e))return!1}else{var f=new Soe;if(r)var h=r(u,c,l,e,t,f);if(!(h===void 0?koe(c,u,Ooe|Coe,r,f):h))return!1}}return!0}var Poe=Aoe,Eoe=Bs;function Toe(e){return e===e&&!Eoe(e)}var s3=Toe,_oe=s3,Moe=aA;function Ioe(e){for(var t=Moe(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,_oe(i)]}return t}var joe=Ioe;function Roe(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var a3=Roe,Noe=Poe,Doe=joe,Loe=a3;function $oe(e){var t=Doe(e);return t.length==1&&t[0][2]?Loe(t[0][0],t[0][1]):function(n){return n===e||Noe(n,e,t)}}var Boe=$oe;function Foe(e,t){return e!=null&&t in Object(e)}var zoe=Foe,Woe=mF,Uoe=iA,Hoe=nr,Voe=oA,qoe=sA,Koe=Xv;function Goe(e,t,n){t=Woe(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=Koe(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&qoe(i)&&Voe(s,i)&&(Hoe(e)||Uoe(e)))}var Qoe=Goe,Xoe=zoe,Yoe=Qoe;function Zoe(e,t){return e!=null&&Yoe(e,t,Xoe)}var Joe=Zoe,ese=lA,tse=gF,nse=Joe,rse=FC,ise=s3,ose=a3,sse=Xv,ase=1,lse=2;function use(e,t){return rse(e)&&ise(t)?ose(sse(e),t):function(n){var r=tse(n,e);return r===void 0&&r===t?nse(n,e):ese(t,r,ase|lse)}}var cse=use;function fse(e){return e}var Mc=fse;function hse(e){return function(t){return t?.[e]}}var dse=hse,pse=KC;function mse(e){return function(t){return pse(t,e)}}var gse=mse,yse=dse,vse=gse,bse=FC,xse=Xv;function wse(e){return bse(e)?yse(xse(e)):vse(e)}var Sse=wse,kse=Boe,Ose=cse,Cse=Mc,Ase=nr,Pse=Sse;function Ese(e){return typeof e=="function"?e:e==null?Cse:typeof e=="object"?Ase(e)?Ose(e[0],e[1]):kse(e):Pse(e)}var Fs=Ese;function Tse(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var _se=Tse;function Mse(e){return e!==e}var Ise=Mse;function jse(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Rse=jse,Nse=_se,Dse=Ise,Lse=Rse;function $se(e,t,n){return t===t?Lse(e,t,n):Nse(e,Dse,n)}var Bse=$se,Fse=Bse;function zse(e,t){var n=e==null?0:e.length;return!!n&&Fse(e,t,0)>-1}var Wse=zse;function Use(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Hse=Use;function Vse(){}var qse=Vse,lx=r3,Kse=qse,Gse=rA,Qse=1/0,Xse=lx&&1/Gse(new lx([,-0]))[1]==Qse?function(e){return new lx(e)}:Kse,Yse=Xse,Zse=KF,Jse=Wse,eae=Hse,tae=QF,nae=Yse,rae=rA,iae=200;function oae(e,t,n){var r=-1,i=Jse,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=eae;else if(o>=iae){var u=t?null:nae(e);if(u)return rae(u);s=!1,i=tae,l=new Zse}else l=t?[]:a;e:for(;++r<o;){var c=e[r],f=t?t(c):c;if(c=n||c!==0?c:0,s&&f===f){for(var h=l.length;h--;)if(l[h]===f)continue e;t&&l.push(f),a.push(c)}else i(l,f,n)||(l!==a&&l.push(f),a.push(c))}return a}var sae=oae,aae=Fs,lae=sae;function uae(e,t){return e&&e.length?lae(e,aae(t)):[]}var cae=uae;const Q_=De(cae);function l3(e,t,n){return t===!0?Q_(e,n):xe(t)?Q_(e,t):e}function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}var fae=["ref"];function X_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X_(Object(n),!0).forEach(function(r){h0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c3(r.key),r)}}function dae(e,t,n){return t&&Y_(e.prototype,t),n&&Y_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pae(e,t,n){return t=Vg(t),mae(e,u3()?Reflect.construct(t,n||[],Vg(e).constructor):t.apply(e,n))}function mae(e,t){if(t&&(Lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gae(e)}function gae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u3=function(){return!!e})()}function Vg(e){return Vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vg(e)}function yae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tS(e,t)}function tS(e,t){return tS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tS(e,t)}function h0(e,t,n){return t=c3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c3(e){var t=vae(e,"string");return Lu(t)=="symbol"?t:t+""}function vae(e,t){if(Lu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function bae(e,t){if(e==null)return{};var n=xae(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wae(e){return e.value}function Sae(e,t){if(L.isValidElement(e))return L.cloneElement(e,t);if(typeof e=="function")return L.createElement(e,t);t.ref;var n=bae(t,fae);return L.createElement(nA,n)}var Z_=1,du=function(e){function t(){var n;hae(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=pae(this,t,[].concat(i)),h0(n,"lastBoundingBox",{width:-1,height:-1}),n}return yae(t,e),dae(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>Z_||Math.abs(i.height-this.lastBoundingBox.height)>Z_)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?no({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var d=this.getBBoxSnapshot();f={left:((u||0)-d.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(a==="middle"){var p=this.getBBoxSnapshot();h={top:((c||0)-p.height)/2}}else h=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return no(no({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=no(no({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return L.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){r.wrapperNode=d}},Sae(o,no(no({},this.props),{},{payload:l3(c,u,wae)})))}}],[{key:"getWithHeight",value:function(r,i){var o=no(no({},this.defaultProps),r.props),s=o.layout;return s==="vertical"&&ne(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])}(C.PureComponent);h0(du,"displayName","Legend");h0(du,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var J_=Kd,kae=iA,Oae=nr,e2=J_?J_.isConcatSpreadable:void 0;function Cae(e){return Oae(e)||kae(e)||!!(e2&&e&&e[e2])}var Aae=Cae,Pae=YF,Eae=Aae;function f3(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=Eae),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?f3(a,t-1,n,r,i):Pae(i,a):r||(i[i.length]=a)}return i}var h3=f3;function Tae(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var _ae=Tae,Mae=_ae,Iae=Mae(),jae=Iae,Rae=jae,Nae=aA;function Dae(e,t){return e&&Rae(e,t,Nae)}var d3=Dae,Lae=f0;function $ae(e,t){return function(n,r){if(n==null)return n;if(!Lae(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var Bae=$ae,Fae=d3,zae=Bae,Wae=zae(Fae),uA=Wae,Uae=uA,Hae=f0;function Vae(e,t){var n=-1,r=Hae(e)?Array(e.length):[];return Uae(e,function(i,o,s){r[++n]=t(i,o,s)}),r}var p3=Vae;function qae(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Kae=qae,t2=kc;function Gae(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=t2(e),s=t!==void 0,a=t===null,l=t===t,u=t2(t);if(!a&&!u&&!o&&e>t||o&&s&&l&&!a&&!u||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!l)return-1}return 0}var Qae=Gae,Xae=Qae;function Yae(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=Xae(i[r],o[r]);if(l){if(r>=a)return l;var u=n[r];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Zae=Yae,ux=qC,Jae=KC,ele=Fs,tle=p3,nle=Kae,rle=e3,ile=Zae,ole=Mc,sle=nr;function ale(e,t,n){t.length?t=ux(t,function(o){return sle(o)?function(s){return Jae(s,o.length===1?o[0]:o)}:o}):t=[ole];var r=-1;t=ux(t,rle(ele));var i=tle(e,function(o,s,a){var l=ux(t,function(u){return u(o)});return{criteria:l,index:++r,value:o}});return nle(i,function(o,s){return ile(o,s,n)})}var lle=ale;function ule(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var cle=ule,fle=cle,n2=Math.max;function hle(e,t,n){return t=n2(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=n2(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),fle(e,this,a)}}var dle=hle;function ple(e){return function(){return e}}var mle=ple,gle=ol,yle=function(){try{var e=gle(Object,"defineProperty");return e({},"",{}),e}catch{}}(),m3=yle,vle=mle,r2=m3,ble=Mc,xle=r2?function(e,t){return r2(e,"toString",{configurable:!0,enumerable:!1,value:vle(t),writable:!0})}:ble,wle=xle,Sle=800,kle=16,Ole=Date.now;function Cle(e){var t=0,n=0;return function(){var r=Ole(),i=kle-(r-n);if(n=r,i>0){if(++t>=Sle)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Ale=Cle,Ple=wle,Ele=Ale,Tle=Ele(Ple),_le=Tle,Mle=Mc,Ile=dle,jle=_le;function Rle(e,t){return jle(Ile(e,t,Mle),e+"")}var Nle=Rle,Dle=WC,Lle=f0,$le=oA,Ble=Bs;function Fle(e,t,n){if(!Ble(n))return!1;var r=typeof t;return(r=="number"?Lle(n)&&$le(t,n.length):r=="string"&&t in n)?Dle(n[t],e):!1}var d0=Fle,zle=h3,Wle=lle,Ule=Nle,i2=d0,Hle=Ule(function(e,t){if(e==null)return[];var n=t.length;return n>1&&i2(e,t[0],t[1])?t=[]:n>2&&i2(t[0],t[1],t[2])&&(t=[t[0]]),Wle(e,zle(t,1),[])}),Vle=Hle;const cA=De(Vle);function $h(e){"@babel/helpers - typeof";return $h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(e)}function nS(){return nS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nS.apply(this,arguments)}function qle(e,t){return Xle(e)||Qle(e,t)||Gle(e,t)||Kle()}function Kle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
272
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gle(e,t){if(e){if(typeof e=="string")return o2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o2(e,t)}}function o2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Xle(e){if(Array.isArray(e))return e}function s2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s2(Object(n),!0).forEach(function(r){Yle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yle(e,t,n){return t=Zle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zle(e){var t=Jle(e,"string");return $h(t)=="symbol"?t:t+""}function Jle(e,t){if($h(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($h(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eue(e){return Array.isArray(e)&&Ht(e[0])&&Ht(e[1])?e.join(" ~ "):e}var tue=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,o=i===void 0?{}:i,s=t.itemStyle,a=s===void 0?{}:s,l=t.labelStyle,u=l===void 0?{}:l,c=t.payload,f=t.formatter,h=t.itemSorter,d=t.wrapperClassName,p=t.labelClassName,m=t.label,y=t.labelFormatter,g=t.accessibilityLayer,v=g===void 0?!1:g,x=function(){if(c&&c.length){var E={padding:0,margin:0},R=(h?cA(c,h):c).map(function(N,j){if(N.type==="none")return null;var B=cx({display:"block",paddingTop:4,paddingBottom:4,color:N.color||"#000"},a),F=N.formatter||f||eue,$=N.value,z=N.name,T=$,q=z;if(F&&T!=null&&q!=null){var D=F($,z,N,j,c);if(Array.isArray(D)){var I=qle(D,2);T=I[0],q=I[1]}else T=D}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(j),style:B},Ht(q)?L.createElement("span",{className:"recharts-tooltip-item-name"},q):null,Ht(q)?L.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,L.createElement("span",{className:"recharts-tooltip-item-value"},T),L.createElement("span",{className:"recharts-tooltip-item-unit"},N.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:E},R)}return null},k=cx({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),w=cx({margin:0},u),S=!we(m),O=S?m:"",A=Se("recharts-default-tooltip",d),P=Se("recharts-tooltip-label",p);S&&y&&c!==void 0&&c!==null&&(O=y(m,c));var M=v?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",nS({className:A,style:k},M),L.createElement("p",{className:P,style:w},L.isValidElement(O)?O:"".concat(O)),x())};function Bh(e){"@babel/helpers - typeof";return Bh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bh(e)}function $p(e,t,n){return t=nue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nue(e){var t=rue(e,"string");return Bh(t)=="symbol"?t:t+""}function rue(e,t){if(Bh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sf="recharts-tooltip-wrapper",iue={visibility:"hidden"};function oue(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Se(sf,$p($p($p($p({},"".concat(sf,"-right"),ne(n)&&t&&ne(t.x)&&n>=t.x),"".concat(sf,"-left"),ne(n)&&t&&ne(t.x)&&n<t.x),"".concat(sf,"-bottom"),ne(r)&&t&&ne(t.y)&&r>=t.y),"".concat(sf,"-top"),ne(r)&&t&&ne(t.y)&&r<t.y))}function a2(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,o=e.position,s=e.reverseDirection,a=e.tooltipDimension,l=e.viewBox,u=e.viewBoxDimension;if(o&&ne(o[r]))return o[r];var c=n[r]-a-i,f=n[r]+i;if(t[r])return s[r]?c:f;if(s[r]){var h=c,d=l[r];return h<d?Math.max(f,l[r]):Math.max(c,l[r])}var p=f+a,m=l[r]+u;return p>m?Math.max(c,l[r]):Math.max(f,l[r])}function sue(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function aue(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,a=e.useTranslate3d,l=e.viewBox,u,c,f;return s.height>0&&s.width>0&&n?(c=a2({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=a2({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),u=sue({translateX:c,translateY:f,useTranslate3d:a})):u=iue,{cssProperties:u,cssClasses:oue({translateX:c,translateY:f,coordinate:n})}}function $u(e){"@babel/helpers - typeof";return $u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$u(e)}function l2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function u2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l2(Object(n),!0).forEach(function(r){iS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y3(r.key),r)}}function cue(e,t,n){return t&&uue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fue(e,t,n){return t=qg(t),hue(e,g3()?Reflect.construct(t,n||[],qg(e).constructor):t.apply(e,n))}function hue(e,t){if(t&&($u(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return due(e)}function due(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g3=function(){return!!e})()}function qg(e){return qg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qg(e)}function pue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rS(e,t)}function iS(e,t,n){return t=y3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y3(e){var t=mue(e,"string");return $u(t)=="symbol"?t:t+""}function mue(e,t){if($u(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($u(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var c2=1,gue=function(e){function t(){var n;lue(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=fue(this,t,[].concat(i)),iS(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),iS(n,"handleKeyDown",function(s){if(s.key==="Escape"){var a,l,u,c;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(a=(l=n.props.coordinate)===null||l===void 0?void 0:l.x)!==null&&a!==void 0?a:0,y:(u=(c=n.props.coordinate)===null||c===void 0?void 0:c.y)!==null&&u!==void 0?u:0}})}}),n}return pue(t,e),cue(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>c2||Math.abs(r.height-this.state.lastBoundingBox.height)>c2)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,p=i.position,m=i.reverseDirection,y=i.useTranslate3d,g=i.viewBox,v=i.wrapperStyle,x=aue({allowEscapeViewBox:s,coordinate:c,offsetTopLeft:d,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:g}),k=x.cssClasses,w=x.cssProperties,S=u2(u2({transition:h&&o?"transform ".concat(a,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},v);return L.createElement("div",{tabIndex:-1,className:k,style:S,ref:function(A){r.wrapperNode=A}},u)}}])}(C.PureComponent),yue=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},sl={isSsr:yue()};function Bu(e){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function f2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function h2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){fA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b3(r.key),r)}}function xue(e,t,n){return t&&bue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wue(e,t,n){return t=Kg(t),Sue(e,v3()?Reflect.construct(t,n||[],Kg(e).constructor):t.apply(e,n))}function Sue(e,t){if(t&&(Bu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kue(e)}function kue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v3=function(){return!!e})()}function Kg(e){return Kg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kg(e)}function Oue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oS(e,t)}function oS(e,t){return oS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},oS(e,t)}function fA(e,t,n){return t=b3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b3(e){var t=Cue(e,"string");return Bu(t)=="symbol"?t:t+""}function Cue(e,t){if(Bu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Aue(e){return e.dataKey}function Pue(e,t){return L.isValidElement(e)?L.cloneElement(e,t):typeof e=="function"?L.createElement(e,t):L.createElement(tue,t)}var ri=function(e){function t(){return vue(this,t),wue(this,t,arguments)}return Oue(t,e),xue(t,[{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,u=i.content,c=i.coordinate,f=i.filterNull,h=i.isAnimationActive,d=i.offset,p=i.payload,m=i.payloadUniqBy,y=i.position,g=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,k=i.wrapperStyle,w=p??[];f&&w.length&&(w=l3(p.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),m,Aue));var S=w.length>0;return L.createElement(gue,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:h,active:o,coordinate:c,hasPayload:S,offset:d,position:y,reverseDirection:g,useTranslate3d:v,viewBox:x,wrapperStyle:k},Pue(u,h2(h2({},this.props),{},{payload:w})))}}])}(C.PureComponent);fA(ri,"displayName","Tooltip");fA(ri,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!sl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Eue=Xi,Tue=function(){return Eue.Date.now()},_ue=Tue,Mue=/\s/;function Iue(e){for(var t=e.length;t--&&Mue.test(e.charAt(t)););return t}var jue=Iue,Rue=jue,Nue=/^\s+/;function Due(e){return e&&e.slice(0,Rue(e)+1).replace(Nue,"")}var Lue=Due,$ue=Lue,d2=Bs,Bue=kc,p2=NaN,Fue=/^[-+]0x[0-9a-f]+$/i,zue=/^0b[01]+$/i,Wue=/^0o[0-7]+$/i,Uue=parseInt;function Hue(e){if(typeof e=="number")return e;if(Bue(e))return p2;if(d2(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=d2(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$ue(e);var n=zue.test(e);return n||Wue.test(e)?Uue(e.slice(2),n?2:8):Fue.test(e)?p2:+e}var x3=Hue,Vue=Bs,fx=_ue,m2=x3,que="Expected a function",Kue=Math.max,Gue=Math.min;function Que(e,t,n){var r,i,o,s,a,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(que);t=m2(t)||0,Vue(n)&&(c=!!n.leading,f="maxWait"in n,o=f?Kue(m2(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function d(S){var O=r,A=i;return r=i=void 0,u=S,s=e.apply(A,O),s}function p(S){return u=S,a=setTimeout(g,t),c?d(S):s}function m(S){var O=S-l,A=S-u,P=t-O;return f?Gue(P,o-A):P}function y(S){var O=S-l,A=S-u;return l===void 0||O>=t||O<0||f&&A>=o}function g(){var S=fx();if(y(S))return v(S);a=setTimeout(g,m(S))}function v(S){return a=void 0,h&&r?d(S):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function k(){return a===void 0?s:v(fx())}function w(){var S=fx(),O=y(S);if(r=arguments,i=this,l=S,O){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(g,t),d(l)}return a===void 0&&(a=setTimeout(g,t)),s}return w.cancel=x,w.flush=k,w}var Xue=Que,Yue=Xue,Zue=Bs,Jue="Expected a function";function ece(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Jue);return Zue(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Yue(e,t,{leading:r,maxWait:t,trailing:i})}var tce=ece;const w3=De(tce);function Fh(e){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fh(e)}function g2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g2(Object(n),!0).forEach(function(r){nce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nce(e,t,n){return t=rce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rce(e){var t=ice(e,"string");return Fh(t)=="symbol"?t:t+""}function ice(e,t){if(Fh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oce(e,t){return uce(e)||lce(e,t)||ace(e,t)||sce()}function sce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
273
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ace(e,t){if(e){if(typeof e=="string")return y2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y2(e,t)}}function y2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function uce(e){if(Array.isArray(e))return e}var S3=C.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,o=e.width,s=o===void 0?"100%":o,a=e.height,l=a===void 0?"100%":a,u=e.minWidth,c=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,d=e.children,p=e.debounce,m=p===void 0?0:p,y=e.id,g=e.className,v=e.onResize,x=e.style,k=x===void 0?{}:x,w=C.useRef(null),S=C.useRef();S.current=v,C.useImperativeHandle(t,function(){return Object.defineProperty(w.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),w.current},configurable:!0})});var O=C.useState({containerWidth:i.width,containerHeight:i.height}),A=oce(O,2),P=A[0],M=A[1],_=C.useCallback(function(R,N){M(function(j){var B=Math.round(R),F=Math.round(N);return j.containerWidth===B&&j.containerHeight===F?j:{containerWidth:B,containerHeight:F}})},[]);C.useEffect(function(){var R=function(z){var T,q=z[0].contentRect,D=q.width,I=q.height;_(D,I),(T=S.current)===null||T===void 0||T.call(S,D,I)};m>0&&(R=w3(R,m,{trailing:!0,leading:!1}));var N=new ResizeObserver(R),j=w.current.getBoundingClientRect(),B=j.width,F=j.height;return _(B,F),N.observe(w.current),function(){N.disconnect()}},[_,m]);var E=C.useMemo(function(){var R=P.containerWidth,N=P.containerHeight;if(R<0||N<0)return null;vo(ya(s)||ya(l),`The width(%s) and height(%s) are both fixed numbers,
274
+ maybe you don't need to use a ResponsiveContainer.`,s,l),vo(!n||n>0,"The aspect(%s) must be greater than zero.",n);var j=ya(s)?R:s,B=ya(l)?N:l;n&&n>0&&(j?B=j/n:B&&(j=B*n),h&&B>h&&(B=h)),vo(j>0||B>0,`The width(%s) and height(%s) of chart should be greater than 0,
275
+ please check the style of container, or the props width(%s) and height(%s),
276
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
277
+ height and width.`,j,B,s,l,c,f,n);var F=!Array.isArray(d)&&yo(d.type).endsWith("Chart");return L.Children.map(d,function($){return L.isValidElement($)?C.cloneElement($,Bp({width:j,height:B},F?{style:Bp({height:"100%",width:"100%",maxHeight:B,maxWidth:j},$.props.style)}:{})):$})},[n,d,l,h,f,c,P,s]);return L.createElement("div",{id:y?"".concat(y):void 0,className:Se("recharts-responsive-container",g),style:Bp(Bp({},k),{},{width:s,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:w},E)}),Fu=function(t){return null};Fu.displayName="Cell";function zh(e){"@babel/helpers - typeof";return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zh(e)}function v2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v2(Object(n),!0).forEach(function(r){cce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cce(e,t,n){return t=fce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fce(e){var t=hce(e,"string");return zh(t)=="symbol"?t:t+""}function hce(e,t){if(zh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wl={widthCache:{},cacheCount:0},dce=2e3,pce={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},b2="recharts_measurement_span";function mce(e){var t=sS({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Vf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||sl.isSsr)return{width:0,height:0};var r=mce(n),i=JSON.stringify({text:t,copyStyle:r});if(wl.widthCache[i])return wl.widthCache[i];try{var o=document.getElementById(b2);o||(o=document.createElement("span"),o.setAttribute("id",b2),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=sS(sS({},pce),r);Object.assign(o.style,s),o.textContent="".concat(t);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return wl.widthCache[i]=l,++wl.cacheCount>dce&&(wl.cacheCount=0,wl.widthCache={}),l}catch{return{width:0,height:0}}},gce=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Wh(e){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wh(e)}function Gg(e,t){return xce(e)||bce(e,t)||vce(e,t)||yce()}function yce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
278
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vce(e,t){if(e){if(typeof e=="string")return x2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x2(e,t)}}function x2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function xce(e){if(Array.isArray(e))return e}function wce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w2(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kce(r.key),r)}}function Sce(e,t,n){return t&&w2(e.prototype,t),n&&w2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kce(e){var t=Oce(e,"string");return Wh(t)=="symbol"?t:t+""}function Oce(e,t){if(Wh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var S2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,k2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Cce=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Ace=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,k3={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Pce=Object.keys(k3),Kl="NaN";function Ece(e,t){return e*k3[t]}var Fp=function(){function e(t,n){wce(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Cce.test(n)&&(this.num=NaN,this.unit=""),Pce.includes(n)&&(this.num=Ece(t,n),this.unit="px")}return Sce(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=Ace.exec(n))!==null&&r!==void 0?r:[],o=Gg(i,3),s=o[1],a=o[2];return new e(parseFloat(s),a??"")}}])}();function O3(e){if(e.includes(Kl))return Kl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=S2.exec(t))!==null&&n!==void 0?n:[],i=Gg(r,4),o=i[1],s=i[2],a=i[3],l=Fp.parse(o??""),u=Fp.parse(a??""),c=s==="*"?l.multiply(u):l.divide(u);if(c.isNaN())return Kl;t=t.replace(S2,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=k2.exec(t))!==null&&f!==void 0?f:[],d=Gg(h,4),p=d[1],m=d[2],y=d[3],g=Fp.parse(p??""),v=Fp.parse(y??""),x=m==="+"?g.add(v):g.subtract(v);if(x.isNaN())return Kl;t=t.replace(k2,x.toString())}return t}var O2=/\(([^()]*)\)/;function Tce(e){for(var t=e;t.includes("(");){var n=O2.exec(t),r=Gg(n,2),i=r[1];t=t.replace(O2,O3(i))}return t}function _ce(e){var t=e.replace(/\s+/g,"");return t=Tce(t),t=O3(t),t}function Mce(e){try{return _ce(e)}catch{return Kl}}function hx(e){var t=Mce(e.slice(5,-1));return t===Kl?"":t}var Ice=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],jce=["dx","dy","angle","className","breakAll"];function aS(){return aS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aS.apply(this,arguments)}function C2(e,t){if(e==null)return{};var n=Rce(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function A2(e,t){return $ce(e)||Lce(e,t)||Dce(e,t)||Nce()}function Nce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
279
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dce(e,t){if(e){if(typeof e=="string")return P2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P2(e,t)}}function P2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function $ce(e){if(Array.isArray(e))return e}var C3=/[ \f\n\r\t\v\u2028\u2029]+/,A3=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var o=[];we(n)||(r?o=n.toString().split(""):o=n.toString().split(C3));var s=o.map(function(l){return{word:l,width:Vf(l,i).width}}),a=r?0:Vf(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:a}}catch{return null}},Bce=function(t,n,r,i,o){var s=t.maxLines,a=t.children,l=t.style,u=t.breakAll,c=ne(s),f=a,h=function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return j.reduce(function(B,F){var $=F.word,z=F.width,T=B[B.length-1];if(T&&(i==null||o||T.width+z+r<Number(i)))T.words.push($),T.width+=z+r;else{var q={words:[$],width:z};B.push(q)}return B},[])},d=h(n),p=function(j){return j.reduce(function(B,F){return B.width>F.width?B:F})};if(!c)return d;for(var m="…",y=function(j){var B=f.slice(0,j),F=A3({breakAll:u,style:l,children:B+m}).wordsWithComputedWidth,$=h(F),z=$.length>s||p($).width>Number(i);return[z,$]},g=0,v=f.length-1,x=0,k;g<=v&&x<=f.length-1;){var w=Math.floor((g+v)/2),S=w-1,O=y(S),A=A2(O,2),P=A[0],M=A[1],_=y(w),E=A2(_,1),R=E[0];if(!P&&!R&&(g=w+1),P&&R&&(v=w-1),!P&&R){k=M;break}x++}return k||d},E2=function(t){var n=we(t)?[]:t.toString().split(C3);return[{words:n}]},Fce=function(t){var n=t.width,r=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,a=t.maxLines;if((n||r)&&!sl.isSsr){var l,u,c=A3({breakAll:s,children:i,style:o});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return E2(i);return Bce({breakAll:s,children:i,maxLines:a,style:o},l,u,n,r)}return E2(i)},T2="#808080",Ka=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.lineHeight,a=s===void 0?"1em":s,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,d=h===void 0?"start":h,p=t.verticalAnchor,m=p===void 0?"end":p,y=t.fill,g=y===void 0?T2:y,v=C2(t,Ice),x=C.useMemo(function(){return Fce({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:f,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,f,v.style,v.width]),k=v.dx,w=v.dy,S=v.angle,O=v.className,A=v.breakAll,P=C2(v,jce);if(!Ht(r)||!Ht(o))return null;var M=r+(ne(k)?k:0),_=o+(ne(w)?w:0),E;switch(m){case"start":E=hx("calc(".concat(u,")"));break;case"middle":E=hx("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(u," / 2))"));break;default:E=hx("calc(".concat(x.length-1," * -").concat(a,")"));break}var R=[];if(f){var N=x[0].width,j=v.width;R.push("scale(".concat((ne(j)?j/N:1)/N,")"))}return S&&R.push("rotate(".concat(S,", ").concat(M,", ").concat(_,")")),R.length&&(P.transform=R.join(" ")),L.createElement("text",aS({},de(P,!0),{x:M,y:_,className:Se("recharts-text",O),textAnchor:d,fill:g.includes("url")?T2:g}),x.map(function(B,F){var $=B.words.join(A?"":" ");return L.createElement("tspan",{x:M,dy:F===0?E:a,key:"".concat($,"-").concat(F)},$)}))};function xs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zce(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hA(e){let t,n,r;e.length!==2?(t=xs,n=(a,l)=>xs(e(a),l),r=(a,l)=>e(a)-l):(t=e===xs||e===zce?e:Wce,n=e,r=e);function i(a,l,u=0,c=a.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(a[f],l)<0?u=f+1:c=f}while(u<c)}return u}function o(a,l,u=0,c=a.length){if(u<c){if(t(l,l)!==0)return c;do{const f=u+c>>>1;n(a[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function s(a,l,u=0,c=a.length){const f=i(a,l,u,c-1);return f>u&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function Wce(){return 0}function P3(e){return e===null?NaN:+e}function*Uce(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Hce=hA(xs),Qd=Hce.right;hA(P3).center;class _2 extends Map{constructor(t,n=Kce){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(M2(this,t))}has(t){return super.has(M2(this,t))}set(t,n){return super.set(Vce(this,t),n)}delete(t){return super.delete(qce(this,t))}}function M2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Vce({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function qce({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Kce(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Gce(e=xs){if(e===xs)return E3;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function E3(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Qce=Math.sqrt(50),Xce=Math.sqrt(10),Yce=Math.sqrt(2);function Qg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Qce?10:o>=Xce?5:o>=Yce?2:1;let a,l,u;return i<0?(u=Math.pow(10,-i)/s,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*s,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=n&&n<2?Qg(e,t,n*2):[a,l,u]}function lS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?Qg(t,e,n):Qg(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let u=0;u<a;++u)l[u]=(o-u)/-s;else for(let u=0;u<a;++u)l[u]=(o-u)*s;else if(s<0)for(let u=0;u<a;++u)l[u]=(i+u)/-s;else for(let u=0;u<a;++u)l[u]=(i+u)*s;return l}function uS(e,t,n){return t=+t,e=+e,n=+n,Qg(e,t,n)[2]}function cS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?uS(t,e,n):uS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function I2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function j2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function T3(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?E3:Gce(i);r>n;){if(r-n>600){const l=r-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(n,Math.floor(t-u*f/l+h)),p=Math.min(r,Math.floor(t+(l-u)*f/l+h));T3(e,t,d,p,i)}const o=e[t];let s=n,a=r;for(af(e,n,t),i(e[r],o)>0&&af(e,n,r);s<a;){for(af(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?af(e,n,a):(++a,af(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function af(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Zce(e,t,n){if(e=Float64Array.from(Uce(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return j2(e);if(t>=1)return I2(e);var r,i=(r-1)*t,o=Math.floor(i),s=I2(T3(e,o).subarray(0,o+1)),a=j2(e.subarray(o+1));return s+(a-s)*(i-o)}}function Jce(e,t,n=P3){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function efe(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Qr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Bo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const fS=Symbol("implicit");function dA(){var e=new _2,t=[],n=[],r=fS;function i(o){let s=e.get(o);if(s===void 0){if(r!==fS)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new _2;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return dA(t,n).unknown(r)},Qr.apply(i,arguments),i}function Uh(){var e=dA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,u=0,c=.5;delete e.unknown;function f(){var h=t().length,d=i<r,p=d?i:r,m=d?r:i;o=(m-p)/Math.max(1,h-l+u*2),a&&(o=Math.floor(o)),p+=(m-p-o*(h-l))*c,s=o*(1-l),a&&(p=Math.round(p),s=Math.round(s));var y=efe(h).map(function(g){return p+o*g});return n(d?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(h){return arguments.length?(a=!!h,f()):a},e.padding=function(h){return arguments.length?(l=Math.min(1,u=+h),f()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),f()):l},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(c=Math.max(0,Math.min(1,h)),f()):c},e.copy=function(){return Uh(t(),[r,i]).round(a).paddingInner(l).paddingOuter(u).align(c)},Qr.apply(f(),arguments)}function _3(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return _3(t())},e}function qf(){return _3(Uh.apply(null,arguments).paddingInner(1))}function pA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function M3(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xd(){}var Hh=.7,Xg=1/Hh,pu="\\s*([+-]?\\d+)\\s*",Vh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tfe=/^#([0-9a-f]{3,8})$/,nfe=new RegExp(`^rgb\\(${pu},${pu},${pu}\\)$`),rfe=new RegExp(`^rgb\\(${zi},${zi},${zi}\\)$`),ife=new RegExp(`^rgba\\(${pu},${pu},${pu},${Vh}\\)$`),ofe=new RegExp(`^rgba\\(${zi},${zi},${zi},${Vh}\\)$`),sfe=new RegExp(`^hsl\\(${Vh},${zi},${zi}\\)$`),afe=new RegExp(`^hsla\\(${Vh},${zi},${zi},${Vh}\\)$`),R2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};pA(Xd,qh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:N2,formatHex:N2,formatHex8:lfe,formatHsl:ufe,formatRgb:D2,toString:D2});function N2(){return this.rgb().formatHex()}function lfe(){return this.rgb().formatHex8()}function ufe(){return I3(this).formatHsl()}function D2(){return this.rgb().formatRgb()}function qh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tfe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?L2(t):n===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=nfe.exec(e))?new Vn(t[1],t[2],t[3],1):(t=rfe.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ife.exec(e))?zp(t[1],t[2],t[3],t[4]):(t=ofe.exec(e))?zp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sfe.exec(e))?F2(t[1],t[2]/100,t[3]/100,1):(t=afe.exec(e))?F2(t[1],t[2]/100,t[3]/100,t[4]):R2.hasOwnProperty(e)?L2(R2[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function L2(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function zp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vn(e,t,n,r)}function cfe(e){return e instanceof Xd||(e=qh(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function hS(e,t,n,r){return arguments.length===1?cfe(e):new Vn(e,t,n,r??1)}function Vn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}pA(Vn,hS,M3(Xd,{brighter(e){return e=e==null?Xg:Math.pow(Xg,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hh:Math.pow(Hh,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(_a(this.r),_a(this.g),_a(this.b),Yg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$2,formatHex:$2,formatHex8:ffe,formatRgb:B2,toString:B2}));function $2(){return`#${va(this.r)}${va(this.g)}${va(this.b)}`}function ffe(){return`#${va(this.r)}${va(this.g)}${va(this.b)}${va((isNaN(this.opacity)?1:this.opacity)*255)}`}function B2(){const e=Yg(this.opacity);return`${e===1?"rgb(":"rgba("}${_a(this.r)}, ${_a(this.g)}, ${_a(this.b)}${e===1?")":`, ${e})`}`}function Yg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _a(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function va(e){return e=_a(e),(e<16?"0":"")+e.toString(16)}function F2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ai(e,t,n,r)}function I3(e){if(e instanceof ai)return new ai(e.h,e.s,e.l,e.opacity);if(e instanceof Xd||(e=qh(e)),!e)return new ai;if(e instanceof ai)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new ai(s,a,l,e.opacity)}function hfe(e,t,n,r){return arguments.length===1?I3(e):new ai(e,t,n,r??1)}function ai(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}pA(ai,hfe,M3(Xd,{brighter(e){return e=e==null?Xg:Math.pow(Xg,e),new ai(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hh:Math.pow(Hh,e),new ai(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Vn(dx(e>=240?e-240:e+120,i,r),dx(e,i,r),dx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ai(z2(this.h),Wp(this.s),Wp(this.l),Yg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Yg(this.opacity);return`${e===1?"hsl(":"hsla("}${z2(this.h)}, ${Wp(this.s)*100}%, ${Wp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function z2(e){return e=(e||0)%360,e<0?e+360:e}function Wp(e){return Math.max(0,Math.min(1,e||0))}function dx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const mA=e=>()=>e;function dfe(e,t){return function(n){return e+n*t}}function pfe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function mfe(e){return(e=+e)==1?j3:function(t,n){return n-t?pfe(t,n,e):mA(isNaN(t)?n:t)}}function j3(e,t){var n=t-e;return n?dfe(e,n):mA(isNaN(e)?t:e)}const W2=function e(t){var n=mfe(t);function r(i,o){var s=n((i=hS(i)).r,(o=hS(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=j3(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function gfe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function yfe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vfe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Ic(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function bfe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Zg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xfe(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ic(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var dS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,px=new RegExp(dS.source,"g");function wfe(e){return function(){return e}}function Sfe(e){return function(t){return e(t)+""}}function kfe(e,t){var n=dS.lastIndex=px.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=dS.exec(e))&&(i=px.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Zg(r,i)})),n=px.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?Sfe(l[0].x):wfe(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)a[(f=l[c]).i]=f.x(u);return a.join("")})}function Ic(e,t){var n=typeof t,r;return t==null||n==="boolean"?mA(t):(n==="number"?Zg:n==="string"?(r=qh(t))?(t=r,W2):kfe:t instanceof qh?W2:t instanceof Date?bfe:yfe(t)?gfe:Array.isArray(t)?vfe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?xfe:Zg)(e,t)}function gA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Ofe(e,t){t===void 0&&(t=e,e=Ic);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function Cfe(e){return function(){return e}}function Jg(e){return+e}var U2=[0,1];function jn(e){return e}function pS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Cfe(isNaN(t)?NaN:.5)}function Afe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Pfe(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=pS(i,r),o=n(s,o)):(r=pS(r,i),o=n(o,s)),function(a){return o(r(a))}}function Efe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=pS(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var l=Qd(e,a,1,r)-1;return o[l](i[l](a))}}function Yd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function p0(){var e=U2,t=U2,n=Ic,r,i,o,s=jn,a,l,u;function c(){var h=Math.min(e.length,t.length);return s!==jn&&(s=Afe(e[0],e[h-1])),a=h>2?Efe:Pfe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=a(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=a(t,e.map(r),Zg)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Jg),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=gA,c()},f.clamp=function(h){return arguments.length?(s=h?!0:jn,c()):s!==jn},f.interpolate=function(h){return arguments.length?(n=h,c()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,c()}}function yA(){return p0()(jn,jn)}function Tfe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ey(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function zu(e){return e=ey(Math.abs(e)),e?e[1]:NaN}function _fe(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function Mfe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Ife=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kh(e){if(!(t=Ife.exec(e)))throw new Error("invalid format: "+e);var t;return new vA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Kh.prototype=vA.prototype;function vA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}vA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function jfe(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var ty;function Rfe(e,t){var n=ey(e,t);if(!n)return ty=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(ty=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ey(e,Math.max(0,t+o-1))[0]}function H2(e,t){var n=ey(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const V2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Tfe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>H2(e*100,t),r:H2,s:Rfe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function q2(e){return e}var K2=Array.prototype.map,G2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nfe(e){var t=e.grouping===void 0||e.thousands===void 0?q2:_fe(K2.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?q2:Mfe(K2.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=Kh(f);var d=f.fill,p=f.align,m=f.sign,y=f.symbol,g=f.zero,v=f.width,x=f.comma,k=f.precision,w=f.trim,S=f.type;S==="n"?(x=!0,S="g"):V2[S]||(k===void 0&&(k=12),w=!0,S="g"),(g||d==="0"&&p==="=")&&(g=!0,d="0",p="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),A=(y==="$"?r:/[%p]/.test(S)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),P=V2[S],M=/[defgprs%]/.test(S);k=k===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function _(E){var R=O,N=A,j,B,F;if(S==="c")N=P(E)+N,E="";else{E=+E;var $=E<0||1/E<0;if(E=isNaN(E)?l:P(Math.abs(E),k),w&&(E=jfe(E)),$&&+E==0&&m!=="+"&&($=!1),R=($?m==="("?m:a:m==="-"||m==="("?"":m)+R,N=(S==="s"&&!isNaN(E)&&ty!==void 0?G2[8+ty/3]:"")+N+($&&m==="("?")":""),M){for(j=-1,B=E.length;++j<B;)if(F=E.charCodeAt(j),48>F||F>57){N=(F===46?i+E.slice(j+1):E.slice(j))+N,E=E.slice(0,j);break}}}x&&!g&&(E=t(E,1/0));var z=R.length+E.length+N.length,T=z<v?new Array(v-z+1).join(d):"";switch(x&&g&&(E=t(T+E,T.length?v-N.length:1/0),T=""),p){case"<":E=R+E+N+T;break;case"=":E=R+T+E+N;break;case"^":E=T.slice(0,z=T.length>>1)+R+E+N+T.slice(z);break;default:E=T+R+E+N;break}return o(E)}return _.toString=function(){return f+""},_}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(zu(h)/3)))*3,p=Math.pow(10,-d),m=u((f=Kh(f),f.type="f",f),{suffix:G2[8+d/3]});return function(y){return m(p*y)}}return{format:u,formatPrefix:c}}var Up,bA,R3;Dfe({thousands:",",grouping:[3],currency:["$",""]});function Dfe(e){return Up=Nfe(e),bA=Up.format,R3=Up.formatPrefix,Up}function Lfe(e){return Math.max(0,-zu(Math.abs(e)))}function $fe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(zu(t)/3)))*3-zu(Math.abs(e)))}function Bfe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zu(t)-zu(e))+1}function N3(e,t,n,r){var i=cS(e,t,n),o;switch(r=Kh(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=$fe(i,s))&&(r.precision=o),R3(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Bfe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Lfe(i))&&(r.precision=o-(r.type==="%")*2);break}}return bA(r)}function zs(e){var t=e.domain;return e.ticks=function(n){var r=t();return lS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return N3(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a<s&&(u=s,s=a,a=u,u=i,i=o,o=u);c-- >0;){if(u=uS(s,a,n),u===l)return r[i]=s,r[o]=a,t(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function ny(){var e=yA();return e.copy=function(){return Yd(e,ny())},Qr.apply(e,arguments),zs(e)}function D3(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Jg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return D3(e).unknown(t)},e=arguments.length?Array.from(e,Jg):[0,1],zs(n)}function L3(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function Q2(e){return Math.log(e)}function X2(e){return Math.exp(e)}function Ffe(e){return-Math.log(-e)}function zfe(e){return-Math.exp(-e)}function Wfe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ufe(e){return e===10?Wfe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Hfe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Y2(e){return(t,n)=>-e(-t,n)}function xA(e){const t=e(Q2,X2),n=t.domain;let r=10,i,o;function s(){return i=Hfe(r),o=Ufe(r),n()[0]<0?(i=Y2(i),o=Y2(o),e(Ffe,zfe)):e(Q2,X2),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c<u;f&&([u,c]=[c,u]);let h=i(u),d=i(c),p,m;const y=a==null?10:+a;let g=[];if(!(r%1)&&d-h<y){if(h=Math.floor(h),d=Math.ceil(d),u>0){for(;h<=d;++h)for(p=1;p<r;++p)if(m=h<0?p/o(-h):p*o(h),!(m<u)){if(m>c)break;g.push(m)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(m=h>0?p/o(-h):p*o(h),!(m<u)){if(m>c)break;g.push(m)}g.length*2<y&&(g=lS(u,c,y))}else g=lS(h,d,Math.min(d-h,y)).map(o);return f?g.reverse():g},t.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Kh(l)).precision==null&&(l.trim=!0),l=bA(l)),a===1/0)return l;const u=Math.max(1,r*a/t.ticks().length);return c=>{let f=c/o(Math.round(i(c)));return f*r<r-.5&&(f*=r),f<=u?l(c):""}},t.nice=()=>n(L3(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function $3(){const e=xA(p0()).domain([1,10]);return e.copy=()=>Yd(e,$3()).base(e.base()),Qr.apply(e,arguments),e}function Z2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function J2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wA(e){var t=1,n=e(Z2(t),J2(t));return n.constant=function(r){return arguments.length?e(Z2(t=+r),J2(t)):t},zs(n)}function B3(){var e=wA(p0());return e.copy=function(){return Yd(e,B3()).constant(e.constant())},Qr.apply(e,arguments)}function eM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Vfe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function qfe(e){return e<0?-e*e:e*e}function SA(e){var t=e(jn,jn),n=1;function r(){return n===1?e(jn,jn):n===.5?e(Vfe,qfe):e(eM(n),eM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},zs(t)}function kA(){var e=SA(p0());return e.copy=function(){return Yd(e,kA()).exponent(e.exponent())},Qr.apply(e,arguments),e}function Kfe(){return kA.apply(null,arguments).exponent(.5)}function tM(e){return Math.sign(e)*e*e}function Gfe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function F3(){var e=yA(),t=[0,1],n=!1,r;function i(o){var s=Gfe(e(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return e.invert(tM(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Jg)).map(tM)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return F3(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Qr.apply(i,arguments),zs(i)}function z3(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=Jce(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[Qd(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(xs),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return z3().domain(e).range(t).unknown(r)},Qr.apply(o,arguments)}function W3(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(l){return l!=null&&l<=l?i[Qd(r,l,0,n)]:o}function a(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,a()):[e,t]},s.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,a()):i.slice()},s.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return W3().domain([e,t]).range(i).unknown(o)},Qr.apply(zs(s),arguments)}function U3(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Qd(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return U3().domain(e).range(t).unknown(n)},Qr.apply(i,arguments)}const mx=new Date,gx=new Date;function qt(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let u;do l.push(u=new Date(+o)),t(o,a),e(o);while(u<o&&o<s);return l},i.filter=o=>qt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(mx.setTime(+o),gx.setTime(+s),e(mx),e(gx),Math.floor(n(mx,gx))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const ry=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ry.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ry);ry.range;const fo=1e3,Br=fo*60,ho=Br*60,Ao=ho*24,OA=Ao*7,nM=Ao*30,yx=Ao*365,ba=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*fo)},(e,t)=>(t-e)/fo,e=>e.getUTCSeconds());ba.range;const CA=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fo)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getMinutes());CA.range;const AA=qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Br)},(e,t)=>(t-e)/Br,e=>e.getUTCMinutes());AA.range;const PA=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fo-e.getMinutes()*Br)},(e,t)=>{e.setTime(+e+t*ho)},(e,t)=>(t-e)/ho,e=>e.getHours());PA.range;const EA=qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ho)},(e,t)=>(t-e)/ho,e=>e.getUTCHours());EA.range;const Zd=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Br)/Ao,e=>e.getDate()-1);Zd.range;const m0=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ao,e=>e.getUTCDate()-1);m0.range;const H3=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ao,e=>Math.floor(e/Ao));H3.range;function al(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Br)/OA)}const g0=al(0),iy=al(1),Qfe=al(2),Xfe=al(3),Wu=al(4),Yfe=al(5),Zfe=al(6);g0.range;iy.range;Qfe.range;Xfe.range;Wu.range;Yfe.range;Zfe.range;function ll(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/OA)}const y0=ll(0),oy=ll(1),Jfe=ll(2),ehe=ll(3),Uu=ll(4),the=ll(5),nhe=ll(6);y0.range;oy.range;Jfe.range;ehe.range;Uu.range;the.range;nhe.range;const TA=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());TA.range;const _A=qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());_A.range;const Po=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Po.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Po.range;const Eo=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Eo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Eo.range;function V3(e,t,n,r,i,o){const s=[[ba,1,fo],[ba,5,5*fo],[ba,15,15*fo],[ba,30,30*fo],[o,1,Br],[o,5,5*Br],[o,15,15*Br],[o,30,30*Br],[i,1,ho],[i,3,3*ho],[i,6,6*ho],[i,12,12*ho],[r,1,Ao],[r,2,2*Ao],[n,1,OA],[t,1,nM],[t,3,3*nM],[e,1,yx]];function a(u,c,f){const h=c<u;h&&([u,c]=[c,u]);const d=f&&typeof f.range=="function"?f:l(u,c,f),p=d?d.range(u,+c+1):[];return h?p.reverse():p}function l(u,c,f){const h=Math.abs(c-u)/f,d=hA(([,,y])=>y).right(s,h);if(d===s.length)return e.every(cS(u/yx,c/yx,f));if(d===0)return ry.every(Math.max(cS(u,c,f),1));const[p,m]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return p.every(m)}return[a,l]}const[rhe,ihe]=V3(Eo,_A,y0,H3,EA,AA),[ohe,she]=V3(Po,TA,g0,Zd,PA,CA);function vx(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function bx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function lf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ahe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,u=uf(i),c=cf(i),f=uf(o),h=cf(o),d=uf(s),p=cf(s),m=uf(a),y=cf(a),g=uf(l),v=cf(l),x={a:F,A:$,b:z,B:T,c:null,d:lM,e:lM,f:_he,g:Fhe,G:Whe,H:Phe,I:Ehe,j:The,L:q3,m:Mhe,M:Ihe,p:q,q:D,Q:fM,s:hM,S:jhe,u:Rhe,U:Nhe,V:Dhe,w:Lhe,W:$he,x:null,X:null,y:Bhe,Y:zhe,Z:Uhe,"%":cM},k={a:I,A:Y,b:G,B:te,c:null,d:uM,e:uM,f:Khe,g:rde,G:ode,H:Hhe,I:Vhe,j:qhe,L:G3,m:Ghe,M:Qhe,p:fe,q:ye,Q:fM,s:hM,S:Xhe,u:Yhe,U:Zhe,V:Jhe,w:ede,W:tde,x:null,X:null,y:nde,Y:ide,Z:sde,"%":cM},w={a:M,A:_,b:E,B:R,c:N,d:sM,e:sM,f:khe,g:oM,G:iM,H:aM,I:aM,j:bhe,L:She,m:vhe,M:xhe,p:P,q:yhe,Q:Che,s:Ahe,S:whe,u:hhe,U:dhe,V:phe,w:fhe,W:mhe,x:j,X:B,y:oM,Y:iM,Z:ghe,"%":Ohe};x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),k.x=S(n,k),k.X=S(r,k),k.c=S(t,k);function S(Q,ue){return function(me){var X=[],qe=-1,Ce=0,ht=Q.length,st,_t,tn;for(me instanceof Date||(me=new Date(+me));++qe<ht;)Q.charCodeAt(qe)===37&&(X.push(Q.slice(Ce,qe)),(_t=rM[st=Q.charAt(++qe)])!=null?st=Q.charAt(++qe):_t=st==="e"?" ":"0",(tn=ue[st])&&(st=tn(me,_t)),X.push(st),Ce=qe+1);return X.push(Q.slice(Ce,qe)),X.join("")}}function O(Q,ue){return function(me){var X=lf(1900,void 0,1),qe=A(X,Q,me+="",0),Ce,ht;if(qe!=me.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(ue&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(Ce=bx(lf(X.y,0,1)),ht=Ce.getUTCDay(),Ce=ht>4||ht===0?oy.ceil(Ce):oy(Ce),Ce=m0.offset(Ce,(X.V-1)*7),X.y=Ce.getUTCFullYear(),X.m=Ce.getUTCMonth(),X.d=Ce.getUTCDate()+(X.w+6)%7):(Ce=vx(lf(X.y,0,1)),ht=Ce.getDay(),Ce=ht>4||ht===0?iy.ceil(Ce):iy(Ce),Ce=Zd.offset(Ce,(X.V-1)*7),X.y=Ce.getFullYear(),X.m=Ce.getMonth(),X.d=Ce.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),ht="Z"in X?bx(lf(X.y,0,1)).getUTCDay():vx(lf(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(ht+5)%7:X.w+X.U*7-(ht+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,bx(X)):vx(X)}}function A(Q,ue,me,X){for(var qe=0,Ce=ue.length,ht=me.length,st,_t;qe<Ce;){if(X>=ht)return-1;if(st=ue.charCodeAt(qe++),st===37){if(st=ue.charAt(qe++),_t=w[st in rM?ue.charAt(qe++):st],!_t||(X=_t(Q,me,X))<0)return-1}else if(st!=me.charCodeAt(X++))return-1}return X}function P(Q,ue,me){var X=u.exec(ue.slice(me));return X?(Q.p=c.get(X[0].toLowerCase()),me+X[0].length):-1}function M(Q,ue,me){var X=d.exec(ue.slice(me));return X?(Q.w=p.get(X[0].toLowerCase()),me+X[0].length):-1}function _(Q,ue,me){var X=f.exec(ue.slice(me));return X?(Q.w=h.get(X[0].toLowerCase()),me+X[0].length):-1}function E(Q,ue,me){var X=g.exec(ue.slice(me));return X?(Q.m=v.get(X[0].toLowerCase()),me+X[0].length):-1}function R(Q,ue,me){var X=m.exec(ue.slice(me));return X?(Q.m=y.get(X[0].toLowerCase()),me+X[0].length):-1}function N(Q,ue,me){return A(Q,t,ue,me)}function j(Q,ue,me){return A(Q,n,ue,me)}function B(Q,ue,me){return A(Q,r,ue,me)}function F(Q){return s[Q.getDay()]}function $(Q){return o[Q.getDay()]}function z(Q){return l[Q.getMonth()]}function T(Q){return a[Q.getMonth()]}function q(Q){return i[+(Q.getHours()>=12)]}function D(Q){return 1+~~(Q.getMonth()/3)}function I(Q){return s[Q.getUTCDay()]}function Y(Q){return o[Q.getUTCDay()]}function G(Q){return l[Q.getUTCMonth()]}function te(Q){return a[Q.getUTCMonth()]}function fe(Q){return i[+(Q.getUTCHours()>=12)]}function ye(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var ue=S(Q+="",x);return ue.toString=function(){return Q},ue},parse:function(Q){var ue=O(Q+="",!1);return ue.toString=function(){return Q},ue},utcFormat:function(Q){var ue=S(Q+="",k);return ue.toString=function(){return Q},ue},utcParse:function(Q){var ue=O(Q+="",!0);return ue.toString=function(){return Q},ue}}}var rM={"-":"",_:" ",0:"0"},en=/^\s*\d+/,lhe=/^%/,uhe=/[\\^$*+?|[\]().{}]/g;function Re(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function che(e){return e.replace(uhe,"\\$&")}function uf(e){return new RegExp("^(?:"+e.map(che).join("|")+")","i")}function cf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function fhe(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function hhe(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function dhe(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function phe(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function mhe(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function iM(e,t,n){var r=en.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function oM(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ghe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function yhe(e,t,n){var r=en.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function vhe(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function sM(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function bhe(e,t,n){var r=en.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function aM(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function xhe(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function whe(e,t,n){var r=en.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function She(e,t,n){var r=en.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function khe(e,t,n){var r=en.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ohe(e,t,n){var r=lhe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Che(e,t,n){var r=en.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ahe(e,t,n){var r=en.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function lM(e,t){return Re(e.getDate(),t,2)}function Phe(e,t){return Re(e.getHours(),t,2)}function Ehe(e,t){return Re(e.getHours()%12||12,t,2)}function The(e,t){return Re(1+Zd.count(Po(e),e),t,3)}function q3(e,t){return Re(e.getMilliseconds(),t,3)}function _he(e,t){return q3(e,t)+"000"}function Mhe(e,t){return Re(e.getMonth()+1,t,2)}function Ihe(e,t){return Re(e.getMinutes(),t,2)}function jhe(e,t){return Re(e.getSeconds(),t,2)}function Rhe(e){var t=e.getDay();return t===0?7:t}function Nhe(e,t){return Re(g0.count(Po(e)-1,e),t,2)}function K3(e){var t=e.getDay();return t>=4||t===0?Wu(e):Wu.ceil(e)}function Dhe(e,t){return e=K3(e),Re(Wu.count(Po(e),e)+(Po(e).getDay()===4),t,2)}function Lhe(e){return e.getDay()}function $he(e,t){return Re(iy.count(Po(e)-1,e),t,2)}function Bhe(e,t){return Re(e.getFullYear()%100,t,2)}function Fhe(e,t){return e=K3(e),Re(e.getFullYear()%100,t,2)}function zhe(e,t){return Re(e.getFullYear()%1e4,t,4)}function Whe(e,t){var n=e.getDay();return e=n>=4||n===0?Wu(e):Wu.ceil(e),Re(e.getFullYear()%1e4,t,4)}function Uhe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Re(t/60|0,"0",2)+Re(t%60,"0",2)}function uM(e,t){return Re(e.getUTCDate(),t,2)}function Hhe(e,t){return Re(e.getUTCHours(),t,2)}function Vhe(e,t){return Re(e.getUTCHours()%12||12,t,2)}function qhe(e,t){return Re(1+m0.count(Eo(e),e),t,3)}function G3(e,t){return Re(e.getUTCMilliseconds(),t,3)}function Khe(e,t){return G3(e,t)+"000"}function Ghe(e,t){return Re(e.getUTCMonth()+1,t,2)}function Qhe(e,t){return Re(e.getUTCMinutes(),t,2)}function Xhe(e,t){return Re(e.getUTCSeconds(),t,2)}function Yhe(e){var t=e.getUTCDay();return t===0?7:t}function Zhe(e,t){return Re(y0.count(Eo(e)-1,e),t,2)}function Q3(e){var t=e.getUTCDay();return t>=4||t===0?Uu(e):Uu.ceil(e)}function Jhe(e,t){return e=Q3(e),Re(Uu.count(Eo(e),e)+(Eo(e).getUTCDay()===4),t,2)}function ede(e){return e.getUTCDay()}function tde(e,t){return Re(oy.count(Eo(e)-1,e),t,2)}function nde(e,t){return Re(e.getUTCFullYear()%100,t,2)}function rde(e,t){return e=Q3(e),Re(e.getUTCFullYear()%100,t,2)}function ide(e,t){return Re(e.getUTCFullYear()%1e4,t,4)}function ode(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Uu(e):Uu.ceil(e),Re(e.getUTCFullYear()%1e4,t,4)}function sde(){return"+0000"}function cM(){return"%"}function fM(e){return+e}function hM(e){return Math.floor(+e/1e3)}var Sl,X3,Y3;ade({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ade(e){return Sl=ahe(e),X3=Sl.format,Sl.parse,Y3=Sl.utcFormat,Sl.utcParse,Sl}function lde(e){return new Date(e)}function ude(e){return e instanceof Date?+e:+new Date(+e)}function MA(e,t,n,r,i,o,s,a,l,u){var c=yA(),f=c.invert,h=c.domain,d=u(".%L"),p=u(":%S"),m=u("%I:%M"),y=u("%I %p"),g=u("%a %d"),v=u("%b %d"),x=u("%B"),k=u("%Y");function w(S){return(l(S)<S?d:a(S)<S?p:s(S)<S?m:o(S)<S?y:r(S)<S?i(S)<S?g:v:n(S)<S?x:k)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?h(Array.from(S,ude)):h().map(lde)},c.ticks=function(S){var O=h();return e(O[0],O[O.length-1],S??10)},c.tickFormat=function(S,O){return O==null?w:u(O)},c.nice=function(S){var O=h();return(!S||typeof S.range!="function")&&(S=t(O[0],O[O.length-1],S??10)),S?h(L3(O,S)):c},c.copy=function(){return Yd(c,MA(e,t,n,r,i,o,s,a,l,u))},c}function cde(){return Qr.apply(MA(ohe,she,Po,TA,g0,Zd,PA,CA,ba,X3).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function fde(){return Qr.apply(MA(rhe,ihe,Eo,_A,y0,m0,EA,AA,ba,Y3).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function v0(){var e=0,t=1,n,r,i,o,s=jn,a=!1,l;function u(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(a=!!f,u):a},u.interpolator=function(f){return arguments.length?(s=f,u):s};function c(f){return function(h){var d,p;return arguments.length?([d,p]=h,s=f(d,p),u):[s(0),s(1)]}}return u.range=c(Ic),u.rangeRound=c(gA),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function Ws(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Z3(){var e=zs(v0()(jn));return e.copy=function(){return Ws(e,Z3())},Bo.apply(e,arguments)}function J3(){var e=xA(v0()).domain([1,10]);return e.copy=function(){return Ws(e,J3()).base(e.base())},Bo.apply(e,arguments)}function e4(){var e=wA(v0());return e.copy=function(){return Ws(e,e4()).constant(e.constant())},Bo.apply(e,arguments)}function IA(){var e=SA(v0());return e.copy=function(){return Ws(e,IA()).exponent(e.exponent())},Bo.apply(e,arguments)}function hde(){return IA.apply(null,arguments).exponent(.5)}function t4(){var e=[],t=jn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Qd(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(xs),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>Zce(e,o/r))},n.copy=function(){return t4(t).domain(e)},Bo.apply(n,arguments)}function b0(){var e=0,t=.5,n=1,r=1,i,o,s,a,l,u=jn,c,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+c(m))-o)*(r*m<r*o?a:l),u(f?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t,n]=m,i=c(e=+e),o=c(t=+t),s=c(n=+n),a=i===o?0:.5/(o-i),l=o===s?0:.5/(s-o),r=o<i?-1:1,d):[e,t,n]},d.clamp=function(m){return arguments.length?(f=!!m,d):f},d.interpolator=function(m){return arguments.length?(u=m,d):u};function p(m){return function(y){var g,v,x;return arguments.length?([g,v,x]=y,u=Ofe(m,[g,v,x]),d):[u(0),u(.5),u(1)]}}return d.range=p(Ic),d.rangeRound=p(gA),d.unknown=function(m){return arguments.length?(h=m,d):h},function(m){return c=m,i=m(e),o=m(t),s=m(n),a=i===o?0:.5/(o-i),l=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function n4(){var e=zs(b0()(jn));return e.copy=function(){return Ws(e,n4())},Bo.apply(e,arguments)}function r4(){var e=xA(b0()).domain([.1,1,10]);return e.copy=function(){return Ws(e,r4()).base(e.base())},Bo.apply(e,arguments)}function i4(){var e=wA(b0());return e.copy=function(){return Ws(e,i4()).constant(e.constant())},Bo.apply(e,arguments)}function jA(){var e=SA(b0());return e.copy=function(){return Ws(e,jA()).exponent(e.exponent())},Bo.apply(e,arguments)}function dde(){return jA.apply(null,arguments).exponent(.5)}const dM=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Uh,scaleDiverging:n4,scaleDivergingLog:r4,scaleDivergingPow:jA,scaleDivergingSqrt:dde,scaleDivergingSymlog:i4,scaleIdentity:D3,scaleImplicit:fS,scaleLinear:ny,scaleLog:$3,scaleOrdinal:dA,scalePoint:qf,scalePow:kA,scaleQuantile:z3,scaleQuantize:W3,scaleRadial:F3,scaleSequential:Z3,scaleSequentialLog:J3,scaleSequentialPow:IA,scaleSequentialQuantile:t4,scaleSequentialSqrt:hde,scaleSequentialSymlog:e4,scaleSqrt:Kfe,scaleSymlog:B3,scaleThreshold:U3,scaleTime:cde,scaleUtc:fde,tickFormat:N3},Symbol.toStringTag,{value:"Module"}));var pde=kc;function mde(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(a===void 0?s===s&&!pde(s):n(s,a)))var a=s,l=o}return l}var x0=mde;function gde(e,t){return e>t}var o4=gde,yde=x0,vde=o4,bde=Mc;function xde(e){return e&&e.length?yde(e,bde,vde):void 0}var wde=xde;const w0=De(wde);function Sde(e,t){return e<t}var s4=Sde,kde=x0,Ode=s4,Cde=Mc;function Ade(e){return e&&e.length?kde(e,Cde,Ode):void 0}var Pde=Ade;const S0=De(Pde);var Ede=qC,Tde=Fs,_de=p3,Mde=nr;function Ide(e,t){var n=Mde(e)?Ede:_de;return n(e,Tde(t))}var jde=Ide,Rde=h3,Nde=jde;function Dde(e,t){return Rde(Nde(e,t),1)}var Lde=Dde;const $de=De(Lde);var Bde=lA;function Fde(e,t){return Bde(e,t)}var zde=Fde;const Jd=De(zde);var jc=1e9,Wde={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},NA,mt=!0,Kr="[DecimalError] ",Ma=Kr+"Invalid argument: ",RA=Kr+"Exponent out of range: ",Rc=Math.floor,ia=Math.pow,Ude=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,yr,Kt=1e7,ct=7,a4=9007199254740991,sy=Rc(a4/ct),le={};le.absoluteValue=le.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};le.comparedTo=le.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};le.decimalPlaces=le.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ct;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};le.dividedBy=le.div=function(e){return bo(this,new this.constructor(e))};le.dividedToIntegerBy=le.idiv=function(e){var t=this,n=t.constructor;return Xe(bo(t,new n(e),0,1),n.precision)};le.equals=le.eq=function(e){return!this.cmp(e)};le.exponent=function(){return Nt(this)};le.greaterThan=le.gt=function(e){return this.cmp(e)>0};le.greaterThanOrEqualTo=le.gte=function(e){return this.cmp(e)>=0};le.isInteger=le.isint=function(){return this.e>this.d.length-2};le.isNegative=le.isneg=function(){return this.s<0};le.isPositive=le.ispos=function(){return this.s>0};le.isZero=function(){return this.s===0};le.lessThan=le.lt=function(e){return this.cmp(e)<0};le.lessThanOrEqualTo=le.lte=function(e){return this.cmp(e)<1};le.logarithm=le.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(yr))throw Error(Kr+"NaN");if(n.s<1)throw Error(Kr+(n.s?"NaN":"-Infinity"));return n.eq(yr)?new r(0):(mt=!1,t=bo(Gh(n,o),Gh(e,o),o),mt=!0,Xe(t,i))};le.minus=le.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?c4(t,e):l4(t,(e.s=-e.s,e))};le.modulo=le.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Kr+"NaN");return n.s?(mt=!1,t=bo(n,e,0,1).times(e),mt=!0,n.minus(t)):Xe(new r(n),i)};le.naturalExponential=le.exp=function(){return u4(this)};le.naturalLogarithm=le.ln=function(){return Gh(this)};le.negated=le.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};le.plus=le.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?l4(t,e):c4(t,(e.s=-e.s,e))};le.precision=le.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ma+e);if(t=Nt(i)+1,r=i.d.length-1,n=r*ct+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};le.squareRoot=le.sqrt=function(){var e,t,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(Kr+"NaN")}for(e=Nt(a),mt=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=Ri(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Rc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(i.toString()),n=l.precision,i=s=n+3;;)if(o=r,r=o.plus(bo(a,o,s+2)).times(.5),Ri(o.d).slice(0,s)===(t=Ri(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Xe(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(t!="9999")break;s+=4}return mt=!0,Xe(r,n)};le.times=le.mul=function(e){var t,n,r,i,o,s,a,l,u,c=this,f=c.constructor,h=c.d,d=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,n=c.e+e.e,l=h.length,u=d.length,l<u&&(o=h,h=d,d=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,i=l+r;i>r;)a=o[i]+d[r]*h[i-r-1]+t,o[i--]=a%Kt|0,t=a/Kt|0;o[i]=(o[i]+t)%Kt|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,mt?Xe(e,f.precision):e};le.toDecimalPlaces=le.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(qi(e,0,jc),t===void 0?t=r.rounding:qi(t,0,8),Xe(n,e+Nt(n)+1,t))};le.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ga(r,!0):(qi(e,0,jc),t===void 0?t=i.rounding:qi(t,0,8),r=Xe(new i(r),e+1,t),n=Ga(r,!0,e+1)),n};le.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?Ga(i):(qi(e,0,jc),t===void 0?t=o.rounding:qi(t,0,8),r=Xe(new o(i),e+Nt(i)+1,t),n=Ga(r.abs(),!1,e+Nt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};le.toInteger=le.toint=function(){var e=this,t=e.constructor;return Xe(new t(e),Nt(e)+1,t.rounding)};le.toNumber=function(){return+this};le.toPower=le.pow=function(e){var t,n,r,i,o,s,a=this,l=a.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(yr);if(a=new l(a),!a.s){if(e.s<1)throw Error(Kr+"Infinity");return a}if(a.eq(yr))return a;if(r=l.precision,e.eq(yr))return Xe(a,r);if(t=e.e,n=e.d.length-1,s=t>=n,o=a.s,s){if((n=c<0?-c:c)<=a4){for(i=new l(yr),t=Math.ceil(r/ct+4),mt=!1;n%2&&(i=i.times(a),mM(i.d,t)),n=Rc(n/2),n!==0;)a=a.times(a),mM(a.d,t);return mt=!0,e.s<0?new l(yr).div(i):Xe(i,r)}}else if(o<0)throw Error(Kr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,a.s=1,mt=!1,i=e.times(Gh(a,r+u)),mt=!0,i=u4(i),i.s=o,i};le.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=Nt(i),r=Ga(i,n<=o.toExpNeg||n>=o.toExpPos)):(qi(e,1,jc),t===void 0?t=o.rounding:qi(t,0,8),i=Xe(new o(i),e,t),n=Nt(i),r=Ga(i,e<=n||n<=o.toExpNeg,e)),r};le.toSignificantDigits=le.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(qi(e,1,jc),t===void 0?t=r.rounding:qi(t,0,8)),Xe(new r(n),e,t)};le.toString=le.valueOf=le.val=le.toJSON=le[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Nt(e),n=e.constructor;return Ga(e,t<=n.toExpNeg||t>=n.toExpPos)};function l4(e,t){var n,r,i,o,s,a,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),mt?Xe(t,f):t;if(l=e.d,u=t.d,s=e.e,i=t.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=u.length):(r=u,i=s,a=l.length),s=Math.ceil(f/ct),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=u.length,a-o<0&&(o=a,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/Kt|0,l[o]%=Kt;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return t.d=l,t.e=i,mt?Xe(t,f):t}function qi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ma+e)}function Ri(e){var t,n,r,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)r=e[t]+"",n=ct-r.length,n&&(o+=Ko(n)),o+=r;s=e[t],r=s+"",n=ct-r.length,n&&(o+=Ko(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}var bo=function(){function e(r,i){var o,s=0,a=r.length;for(r=r.slice();a--;)o=r[a]*i+s,r[a]=o%Kt|0,s=o/Kt|0;return s&&r.unshift(s),r}function t(r,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(r[a]!=i[a]){l=r[a]>i[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]<i[o]?1:0,r[o]=s*Kt+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,s){var a,l,u,c,f,h,d,p,m,y,g,v,x,k,w,S,O,A,P=r.constructor,M=r.s==i.s?1:-1,_=r.d,E=i.d;if(!r.s)return new P(r);if(!i.s)throw Error(Kr+"Division by zero");for(l=r.e-i.e,O=E.length,w=_.length,d=new P(M),p=d.d=[],u=0;E[u]==(_[u]||0);)++u;if(E[u]>(_[u]||0)&&--l,o==null?v=o=P.precision:s?v=o+(Nt(r)-Nt(i))+1:v=o,v<0)return new P(0);if(v=v/ct+2|0,u=0,O==1)for(c=0,E=E[0],v++;(u<w||c)&&v--;u++)x=c*Kt+(_[u]||0),p[u]=x/E|0,c=x%E|0;else{for(c=Kt/(E[0]+1)|0,c>1&&(E=e(E,c),_=e(_,c),O=E.length,w=_.length),k=O,m=_.slice(0,O),y=m.length;y<O;)m[y++]=0;A=E.slice(),A.unshift(0),S=E[0],E[1]>=Kt/2&&++S;do c=0,a=t(E,m,O,y),a<0?(g=m[0],O!=y&&(g=g*Kt+(m[1]||0)),c=g/S|0,c>1?(c>=Kt&&(c=Kt-1),f=e(E,c),h=f.length,y=m.length,a=t(f,m,h,y),a==1&&(c--,n(f,O<h?A:E,h))):(c==0&&(a=c=1),f=E.slice()),h=f.length,h<y&&f.unshift(0),n(m,f,y),a==-1&&(y=m.length,a=t(E,m,O,y),a<1&&(c++,n(m,O<y?A:E,y))),y=m.length):a===0&&(c++,m=[0]),p[u++]=c,a&&m[0]?m[y++]=_[k]||0:(m=[_[k]],y=1);while((k++<w||m[0]!==void 0)&&v--)}return p[0]||p.shift(),d.e=l,Xe(d,s?o+Nt(d)+1:o)}}();function u4(e,t){var n,r,i,o,s,a,l=0,u=0,c=e.constructor,f=c.precision;if(Nt(e)>16)throw Error(RA+Nt(e));if(!e.s)return new c(yr);for(mt=!1,a=f,s=new c(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(ia(2,u))/Math.LN10*2+5|0,a+=r,n=i=o=new c(yr),c.precision=a;;){if(i=Xe(i.times(e),a),n=n.times(++l),s=o.plus(bo(i,n,a)),Ri(s.d).slice(0,a)===Ri(o.d).slice(0,a)){for(;u--;)o=Xe(o.times(o),a);return c.precision=f,t==null?(mt=!0,Xe(o,f)):o}o=s}}function Nt(e){for(var t=e.e*ct,n=e.d[0];n>=10;n/=10)t++;return t}function xx(e,t,n){if(t>e.LN10.sd())throw mt=!0,n&&(e.precision=n),Error(Kr+"LN10 precision limit exceeded");return Xe(new e(e.LN10),t)}function Ko(e){for(var t="";e--;)t+="0";return t}function Gh(e,t){var n,r,i,o,s,a,l,u,c,f=1,h=10,d=e,p=d.d,m=d.constructor,y=m.precision;if(d.s<1)throw Error(Kr+(d.s?"NaN":"-Infinity"));if(d.eq(yr))return new m(0);if(t==null?(mt=!1,u=y):u=t,d.eq(10))return t==null&&(mt=!0),xx(m,u);if(u+=h,m.precision=u,n=Ri(p),r=n.charAt(0),o=Nt(d),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)d=d.times(e),n=Ri(d.d),r=n.charAt(0),f++;o=Nt(d),r>1?(d=new m("0."+n),o++):d=new m(r+"."+n.slice(1))}else return l=xx(m,u+2,y).times(o+""),d=Gh(new m(r+"."+n.slice(1)),u-h).plus(l),m.precision=y,t==null?(mt=!0,Xe(d,y)):d;for(a=s=d=bo(d.minus(yr),d.plus(yr),u),c=Xe(d.times(d),u),i=3;;){if(s=Xe(s.times(c),u),l=a.plus(bo(s,new m(i),u)),Ri(l.d).slice(0,u)===Ri(a.d).slice(0,u))return a=a.times(2),o!==0&&(a=a.plus(xx(m,u+2,y).times(o+""))),a=bo(a,new m(f),u),m.precision=y,t==null?(mt=!0,Xe(a,y)):a;a=l,i+=2}}function pM(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Rc(n/ct),e.d=[],r=(n+1)%ct,n<0&&(r+=ct),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ct;r<i;)e.d.push(+t.slice(r,r+=ct));t=t.slice(r),r=ct-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),mt&&(e.e>sy||e.e<-sy))throw Error(RA+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xe(e,t,n){var r,i,o,s,a,l,u,c,f=e.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=t-s,r<0)r+=ct,i=t,u=f[c=0];else{if(c=Math.ceil((r+1)/ct),o=f.length,c>=o)return e;for(u=o=f[c],s=1;o>=10;o/=10)s++;r%=ct,i=r-ct+s}if(n!==void 0&&(o=ia(10,s-i-1),a=u/o%10|0,l=t<0||f[c+1]!==void 0||u%o,l=n<4?(a||l)&&(n==0||n==(e.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?u/ia(10,s-i):0:f[c-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(o=Nt(e),f.length=1,t=t-o-1,f[0]=ia(10,(ct-t%ct)%ct),e.e=Rc(-t/ct)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=c,o=1,c--):(f.length=c+1,o=ia(10,ct-r),f[c]=i>0?(u/ia(10,s-i)%ia(10,i)|0)*o:0),l)for(;;)if(c==0){(f[0]+=o)==Kt&&(f[0]=1,++e.e);break}else{if(f[c]+=o,f[c]!=Kt)break;f[c--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(mt&&(e.e>sy||e.e<-sy))throw Error(RA+Nt(e));return e}function c4(e,t){var n,r,i,o,s,a,l,u,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),mt?Xe(t,d):t;if(l=e.d,f=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(c=s<0,c?(n=l,s=-s,a=f.length):(n=f,r=u,a=l.length),i=Math.max(Math.ceil(d/ct),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,c=i<a,c&&(a=i),i=0;i<a;i++)if(l[i]!=f[i]){c=l[i]<f[i];break}s=0}for(c&&(n=l,l=f,f=n,t.s=-t.s),a=l.length,i=f.length-a;i>0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]<f[i]){for(o=i;o&&l[--o]===0;)l[o]=Kt-1;--l[o],l[i]+=Kt}l[i]-=f[i]}for(;l[--a]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,mt?Xe(t,d):t):new h(0)}function Ga(e,t,n){var r,i=Nt(e),o=Ri(e.d),s=o.length;return t?(n&&(r=n-s)>0?o=o.charAt(0)+"."+o.slice(1)+Ko(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Ko(-i-1)+o,n&&(r=n-s)>0&&(o+=Ko(r))):i>=s?(o+=Ko(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Ko(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(o+="."),o+=Ko(r))),e.s<0?"-"+o:o}function mM(e,t){if(e.length>t)return e.length=t,!0}function f4(e){var t,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Ma+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return pM(s,o.toString())}else if(typeof o!="string")throw Error(Ma+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,Ude.test(o))pM(s,o);else throw Error(Ma+o)}if(i.prototype=le,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=f4,i.config=i.set=Hde,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Hde(e){if(!e||typeof e!="object")throw Error(Kr+"Object expected");var t,n,r,i=["precision",1,jc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Rc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ma+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ma+n+": "+r);return this}var NA=f4(Wde);yr=new NA(1);const He=NA;function Vde(e){return Qde(e)||Gde(e)||Kde(e)||qde()}function qde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
280
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kde(e,t){if(e){if(typeof e=="string")return mS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mS(e,t)}}function Gde(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Qde(e){if(Array.isArray(e))return mS(e)}function mS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xde=function(t){return t},h4={},d4=function(t){return t===h4},gM=function(t){return function n(){return arguments.length===0||arguments.length===1&&d4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Yde=function e(t,n){return t===1?n:gM(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=i.filter(function(a){return a!==h4}).length;return s>=t?n.apply(void 0,i):e(t-s,gM(function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];var c=i.map(function(f){return d4(f)?l.shift():f});return n.apply(void 0,Vde(c).concat(l))}))})},k0=function(t){return Yde(t.length,t)},gS=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},Zde=k0(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Jde=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Xde;var i=n.reverse(),o=i[0],s=i.slice(1);return function(){return s.reduce(function(a,l){return l(a)},o.apply(void 0,arguments))}},yS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},p4=function(t){var n=null,r=null;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return n&&o.every(function(a,l){return a===n[l]})||(n=o,r=t.apply(void 0,o)),r}};function epe(e){var t;return e===0?t=1:t=Math.floor(new He(e).abs().log(10).toNumber())+1,t}function tpe(e,t,n){for(var r=new He(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var npe=k0(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),rpe=k0(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),ipe=k0(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const O0={rangeStep:tpe,getDigitCount:epe,interpolateNumber:npe,uninterpolateNumber:rpe,uninterpolateTruncation:ipe};function vS(e){return ape(e)||spe(e)||m4(e)||ope()}function ope(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
281
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function spe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ape(e){if(Array.isArray(e))return bS(e)}function Qh(e,t){return cpe(e)||upe(e,t)||m4(e,t)||lpe()}function lpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
282
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m4(e,t){if(e){if(typeof e=="string")return bS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bS(e,t)}}function bS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function upe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function cpe(e){if(Array.isArray(e))return e}function g4(e){var t=Qh(e,2),n=t[0],r=t[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function y4(e,t,n){if(e.lte(0))return new He(0);var r=O0.getDigitCount(e.toNumber()),i=new He(10).pow(r),o=e.div(i),s=r!==1?.05:.1,a=new He(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return t?l:new He(Math.ceil(l))}function fpe(e,t,n){var r=1,i=new He(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new He(10).pow(O0.getDigitCount(e)-1),i=new He(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new He(Math.floor(e)))}else e===0?i=new He(Math.floor((t-1)/2)):n||(i=new He(Math.floor(e)));var s=Math.floor((t-1)/2),a=Jde(Zde(function(l){return i.add(new He(l-s).mul(r)).toNumber()}),gS);return a(0,t)}function v4(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new He(0),tickMin:new He(0),tickMax:new He(0)};var o=y4(new He(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new He(0):(s=new He(e).add(t).div(2),s=s.sub(new He(s).mod(o)));var a=Math.ceil(s.sub(e).div(o).toNumber()),l=Math.ceil(new He(t).sub(s).div(o).toNumber()),u=a+l+1;return u>n?v4(e,t,n,r,i+1):(u<n&&(l=t>0?l+(n-u):l,a=t>0?a:a+(n-u)),{step:o,tickMin:s.sub(new He(a).mul(o)),tickMax:s.add(new He(l).mul(o))})}function hpe(e){var t=Qh(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),a=g4([n,r]),l=Qh(a,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(vS(gS(0,i-1).map(function(){return 1/0}))):[].concat(vS(gS(0,i-1).map(function(){return-1/0})),[c]);return n>r?yS(f):f}if(u===c)return fpe(u,i,o);var h=v4(u,c,s,o),d=h.step,p=h.tickMin,m=h.tickMax,y=O0.rangeStep(p,m.add(new He(.1).mul(d)),d);return n>r?yS(y):y}function dpe(e,t){var n=Qh(e,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=g4([r,i]),a=Qh(s,2),l=a[0],u=a[1];if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var c=Math.max(t,2),f=y4(new He(u).sub(l).div(c-1),o,0),h=[].concat(vS(O0.rangeStep(new He(l),new He(u).sub(new He(.99).mul(f)),f)),[u]);return r>i?yS(h):h}var ppe=p4(hpe),mpe=p4(dpe),gpe="Invariant failed";function Qa(e,t){throw new Error(gpe)}var ype=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function ay(){return ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ay.apply(this,arguments)}function vpe(e,t){return Spe(e)||wpe(e,t)||xpe(e,t)||bpe()}function bpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
283
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xpe(e,t){if(e){if(typeof e=="string")return yM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yM(e,t)}}function yM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wpe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Spe(e){if(Array.isArray(e))return e}function kpe(e,t){if(e==null)return{};var n=Ope(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ope(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Cpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ape(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w4(r.key),r)}}function Ppe(e,t,n){return t&&Ape(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Epe(e,t,n){return t=ly(t),Tpe(e,b4()?Reflect.construct(t,n||[],ly(e).constructor):t.apply(e,n))}function Tpe(e,t){if(t&&(Hu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _pe(e)}function _pe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(b4=function(){return!!e})()}function ly(e){return ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ly(e)}function Mpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xS(e,t)}function xS(e,t){return xS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},xS(e,t)}function x4(e,t,n){return t=w4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w4(e){var t=Ipe(e,"string");return Hu(t)=="symbol"?t:t+""}function Ipe(e,t){if(Hu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ep=function(e){function t(){return Cpe(this,t),Epe(this,t,arguments)}return Mpe(t,e),Ppe(t,[{key:"render",value:function(){var r=this.props,i=r.offset,o=r.layout,s=r.width,a=r.dataKey,l=r.data,u=r.dataPointFormatter,c=r.xAxis,f=r.yAxis,h=kpe(r,ype),d=de(h,!1);this.props.direction==="x"&&c.type!=="number"&&Qa();var p=l.map(function(m){var y=u(m,a),g=y.x,v=y.y,x=y.value,k=y.errorVal;if(!k)return null;var w=[],S,O;if(Array.isArray(k)){var A=vpe(k,2);S=A[0],O=A[1]}else S=O=k;if(o==="vertical"){var P=c.scale,M=v+i,_=M+s,E=M-s,R=P(x-S),N=P(x+O);w.push({x1:N,y1:_,x2:N,y2:E}),w.push({x1:R,y1:M,x2:N,y2:M}),w.push({x1:R,y1:_,x2:R,y2:E})}else if(o==="horizontal"){var j=f.scale,B=g+i,F=B-s,$=B+s,z=j(x-S),T=j(x+O);w.push({x1:F,y1:T,x2:$,y2:T}),w.push({x1:B,y1:z,x2:B,y2:T}),w.push({x1:F,y1:z,x2:$,y2:z})}return L.createElement(je,ay({className:"recharts-errorBar",key:"bar-".concat(w.map(function(q){return"".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))},d),w.map(function(q){return L.createElement("line",ay({},q,{key:"line-".concat(q.x1,"-").concat(q.x2,"-").concat(q.y1,"-").concat(q.y2)}))}))});return L.createElement(je,{className:"recharts-errorBars"},p)}}])}(L.Component);x4(ep,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});x4(ep,"displayName","ErrorBar");function Xh(e){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xh(e)}function vM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(n),!0).forEach(function(r){jpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jpe(e,t,n){return t=Rpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rpe(e){var t=Npe(e,"string");return Xh(t)=="symbol"?t:t+""}function Npe(e,t){if(Xh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S4=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,o=t.legendContent,s=dr(n,du);if(!s)return null;var a=du.defaultProps,l=a!==void 0?Xs(Xs({},a),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:o==="children"?u=(r||[]).reduce(function(c,f){var h=f.item,d=f.props,p=d.sectors||d.data||[];return c.concat(p.map(function(m){return{type:s.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(c){var f=c.item,h=f.type.defaultProps,d=h!==void 0?Xs(Xs({},h),f.props):{},p=d.dataKey,m=d.name,y=d.legendType,g=d.hide;return{inactive:g,dataKey:p,type:l.iconType||y||"square",color:DA(f),value:m||p,payload:d}}),Xs(Xs(Xs({},l),du.getWithHeight(s,i)),{},{payload:u,item:s})};function Yh(e){"@babel/helpers - typeof";return Yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yh(e)}function bM(e){return Bpe(e)||$pe(e)||Lpe(e)||Dpe()}function Dpe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
284
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lpe(e,t){if(e){if(typeof e=="string")return wS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wS(e,t)}}function $pe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bpe(e){if(Array.isArray(e))return wS(e)}function wS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xM(Object(n),!0).forEach(function(r){mu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mu(e,t,n){return t=Fpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fpe(e){var t=zpe(e,"string");return Yh(t)=="symbol"?t:t+""}function zpe(e,t){if(Yh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zt(e,t,n){return we(e)||we(t)?n:Ht(t)?Sr(e,t,n):xe(t)?t(e):n}function Kf(e,t,n,r){var i=$de(e,function(a){return zt(a,t)});if(n==="number"){var o=i.filter(function(a){return ne(a)||parseFloat(a)});return o.length?[S0(o),w0(o)]:[1/0,-1/0]}var s=r?i.filter(function(a){return!we(a)}):i;return s.map(function(a){return Ht(a)||a instanceof Date?a:""})}var Wpe=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,a=(n=r?.length)!==null&&n!==void 0?n:0;if(a<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,u=0;u<a;u++){var c=u>0?i[u-1].coordinate:i[a-1].coordinate,f=i[u].coordinate,h=u>=a-1?i[0].coordinate:i[u+1].coordinate,d=void 0;if(Mn(f-c)!==Mn(h-f)){var p=[];if(Mn(h-f)===Mn(l[1]-l[0])){d=h;var m=f+l[1]-l[0];p[0]=Math.min(m,(m+c)/2),p[1]=Math.max(m,(m+c)/2)}else{d=c;var y=h+l[1]-l[0];p[0]=Math.min(f,(y+f)/2),p[1]=Math.max(f,(y+f)/2)}var g=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(t>g[0]&&t<=g[1]||t>=p[0]&&t<=p[1]){s=i[u].index;break}}else{var v=Math.min(c,h),x=Math.max(c,h);if(t>(v+f)/2&&t<=(x+f)/2){s=i[u].index;break}}}else for(var k=0;k<a;k++)if(k===0&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k>0&&k<a-1&&t>(r[k].coordinate+r[k-1].coordinate)/2&&t<=(r[k].coordinate+r[k+1].coordinate)/2||k===a-1&&t>(r[k].coordinate+r[k-1].coordinate)/2){s=r[k].index;break}return s},DA=function(t){var n,r=t,i=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?wt(wt({},t.type.defaultProps),t.props):t.props,s=o.stroke,a=o.fill,l;switch(i){case"Line":l=s;break;case"Area":case"Radar":l=s&&s!=="none"?s:a;break;default:l=a;break}return l},Upe=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,u=a.length;l<u;l++)for(var c=o[a[l]].stackGroups,f=Object.keys(c),h=0,d=f.length;h<d;h++){var p=c[f[h]],m=p.items,y=p.cateAxisId,g=m.filter(function(O){return yo(O.type).indexOf("Bar")>=0});if(g&&g.length){var v=g[0].type.defaultProps,x=v!==void 0?wt(wt({},v),g[0].props):g[0].props,k=x.barSize,w=x[y];s[w]||(s[w]=[]);var S=we(k)?n:k;s[w].push({item:g[0],stackList:g.slice(1),barSize:we(S)?void 0:In(S,r,0)})}}return s},Hpe=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,a=t.maxBarSize,l=s.length;if(l<1)return null;var u=In(n,i,0,!0),c,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,d=i/l,p=s.reduce(function(k,w){return k+w.barSize||0},0);p+=(l-1)*u,p>=i&&(p-=(l-1)*u,u=0),p>=i&&d>0&&(h=!0,d*=.9,p=l*d);var m=(i-p)/2>>0,y={offset:m-u,size:0};c=s.reduce(function(k,w){var S={item:w.item,position:{offset:y.offset+y.size+u,size:h?d:w.barSize}},O=[].concat(bM(k),[S]);return y=O[O.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){O.push({item:A,position:y})}),O},f)}else{var g=In(r,i,0,!0);i-2*g-(l-1)*u<=0&&(u=0);var v=(i-2*g-(l-1)*u)/l;v>1&&(v>>=0);var x=a===+a?Math.min(v,a):v;c=s.reduce(function(k,w,S){var O=[].concat(bM(k),[{item:w.item,position:{offset:g+(v+u)*S+(v-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(A){O.push({item:A,position:O[O.length-1].position})}),O},f)}return c},Vpe=function(t,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),u=S4({children:o,legendWidth:l});if(u){var c=i||{},f=c.width,h=c.height,d=u.align,p=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&d!=="center"&&ne(t[d]))return wt(wt({},t),{},mu({},d,t[d]+(f||0)));if((m==="horizontal"||m==="vertical"&&d==="center")&&p!=="middle"&&ne(t[p]))return wt(wt({},t),{},mu({},p,t[p]+(h||0)))}return t},qpe=function(t,n,r){return we(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},k4=function(t,n,r,i,o){var s=n.props.children,a=kr(s,ep).filter(function(u){return qpe(i,o,u.props.direction)});if(a&&a.length){var l=a.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var f=zt(c,r);if(we(f))return u;var h=Array.isArray(f)?[S0(f),w0(f)]:[f,f],d=l.reduce(function(p,m){var y=zt(c,m,0),g=h[0]-Math.abs(Array.isArray(y)?y[0]:y),v=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(g,p[0]),Math.max(v,p[1])]},[1/0,-1/0]);return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0])}return null},Kpe=function(t,n,r,i,o){var s=n.map(function(a){return k4(t,a,r,o,i)}).filter(function(a){return!we(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},O4=function(t,n,r,i,o){var s=n.map(function(l){var u=l.props.dataKey;return r==="number"&&u&&k4(t,l,u,i)||Kf(t,u,r,o)});if(r==="number")return s.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,u){for(var c=0,f=u.length;c<f;c++)a[u[c]]||(a[u[c]]=!0,l.push(u[c]));return l},[])},C4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},xa=function(t,n,r){if(!t)return null;var i=t.scale,o=t.duplicateDomain,s=t.type,a=t.range,l=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&s==="category"&&i.bandwidth?i.bandwidth()/l:0;if(u=t.axisType==="angleAxis"&&a?.length>=2?Mn(a[0]-a[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=o?o.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return c.filter(function(f){return!Gd(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:o?o[f]:f,index:h,offset:u}})},wx=new WeakMap,Hp=function(t,n){if(typeof n!="function")return t;wx.has(t)||wx.set(t,new WeakMap);var r=wx.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},A4=function(t,n,r){var i=t.scale,o=t.type,s=t.layout,a=t.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:Uh(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:ny(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:qf(),realScaleType:"point"}:o==="category"?{scale:Uh(),realScaleType:"band"}:{scale:ny(),realScaleType:"linear"};if(Va(i)){var l="scale".concat(a0(i));return{scale:(dM[l]||qf)(),realScaleType:dM[l]?l:"point"}}return xe(i)?{scale:i}:{scale:qf(),realScaleType:"point"}},wM=1e-4,P4=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),o=Math.min(i[0],i[1])-wM,s=Math.max(i[0],i[1])+wM,a=t(n[0]),l=t(n[r-1]);(a<o||a>s||l<o||l>s)&&t.domain([n[0],n[r-1]])}},Gpe=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},Qpe=function(t,n){if(!n||n.length!==2||!ne(n[0])||!ne(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),o=[t[0],t[1]];return(!ne(t[0])||t[0]<r)&&(o[0]=r),(!ne(t[1])||t[1]>i)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]<r&&(o[1]=r),o},Xpe=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var o=0,s=0,a=0;a<n;++a){var l=Gd(t[a][r][1])?t[a][r][0]:t[a][r][1];l>=0?(t[a][r][0]=o,t[a][r][1]=o+l,o=t[a][r][1]):(t[a][r][0]=s,t[a][r][1]=s+l,s=t[a][r][1])}},Ype=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var o=0,s=0;s<n;++s){var a=Gd(t[s][r][1])?t[s][r][0]:t[s][r][1];a>=0?(t[s][r][0]=o,t[s][r][1]=o+a,o=t[s][r][1]):(t[s][r][0]=0,t[s][r][1]=0)}},Zpe={sign:Xpe,expand:gte,none:Nu,silhouette:yte,wiggle:vte,positive:Ype},Jpe=function(t,n,r){var i=n.map(function(a){return a.props.dataKey}),o=Zpe[r],s=mte().keys(i).value(function(a,l){return+zt(a,l,0)}).order(qw).offset(o);return s(t)},eme=function(t,n,r,i,o,s){if(!t)return null;var a=s?n.reverse():n,l={},u=a.reduce(function(f,h){var d,p=(d=h.type)!==null&&d!==void 0&&d.defaultProps?wt(wt({},h.type.defaultProps),h.props):h.props,m=p.stackId,y=p.hide;if(y)return f;var g=p[r],v=f[g]||{hasStack:!1,stackGroups:{}};if(Ht(m)){var x=v.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(h),v.hasStack=!0,v.stackGroups[m]=x}else v.stackGroups[Ec("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return wt(wt({},f),{},mu({},g,v))},l),c={};return Object.keys(u).reduce(function(f,h){var d=u[h];if(d.hasStack){var p={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(m,y){var g=d.stackGroups[y];return wt(wt({},m),{},mu({},y,{numericAxisId:r,cateAxisId:i,items:g.items,stackedData:Jpe(t,g.items,o)}))},p)}return wt(wt({},f),{},mu({},h,d))},c)},E4=function(t,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=ppe(u,o,a);return t.domain([S0(c),w0(c)]),{niceTicks:c}}if(o&&i==="number"){var f=t.domain(),h=mpe(f,o,a);return{niceTicks:h}}return null};function SM(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!we(i[t.dataKey])){var a=Rg(n,"value",i[t.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=zt(i,we(s)?t.dataKey:s);return we(l)?null:t.scale(l)}var kM=function(t){var n=t.axis,r=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,a=t.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=zt(s,n.dataKey,n.domain[a]);return we(l)?null:n.scale(l)-o/2+i},tme=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},nme=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?wt(wt({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Ht(o)){var s=n[o];if(s){var a=s.items.indexOf(t);return a>=0?s.stackedData[a]:null}}return null},rme=function(t){return t.reduce(function(n,r){return[S0(r.concat([n[0]]).filter(ne)),w0(r.concat([n[1]]).filter(ne))]},[1/0,-1/0])},T4=function(t,n,r){return Object.keys(t).reduce(function(i,o){var s=t[o],a=s.stackedData,l=a.reduce(function(u,c){var f=rme(c.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},OM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,CM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,SS=function(t,n,r){if(xe(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ne(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(OM.test(t[0])){var o=+OM.exec(t[0])[1];i[0]=n[0]-o}else xe(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ne(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(CM.test(t[1])){var s=+CM.exec(t[1])[1];i[1]=n[1]+s}else xe(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},uy=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var o=cA(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;a<l;a++){var u=o[a],c=o[a-1];s=Math.min((u.coordinate||0)-(c.coordinate||0),s)}return s===1/0?0:s}return r?void 0:0},AM=function(t,n,r){return!t||!t.length||Jd(t,Sr(r,"type.defaultProps.domain"))?n:t},_4=function(t,n){var r=t.type.defaultProps?wt(wt({},t.type.defaultProps),t.props):t.props,i=r.dataKey,o=r.name,s=r.unit,a=r.formatter,l=r.tooltipType,u=r.chartType,c=r.hide;return wt(wt({},de(t,!1)),{},{dataKey:i,unit:s,formatter:a,name:o||i,color:DA(t),value:zt(n,i),type:l,payload:n,chartType:u,hide:c})};function Zh(e){"@babel/helpers - typeof";return Zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zh(e)}function PM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function io(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PM(Object(n),!0).forEach(function(r){M4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M4(e,t,n){return t=ime(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ime(e){var t=ome(e,"string");return Zh(t)=="symbol"?t:t+""}function ome(e,t){if(Zh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sme(e,t){return cme(e)||ume(e,t)||lme(e,t)||ame()}function ame(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
285
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lme(e,t){if(e){if(typeof e=="string")return EM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EM(e,t)}}function EM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ume(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function cme(e){if(Array.isArray(e))return e}var cy=Math.PI/180,fme=function(t){return t*180/Math.PI},ot=function(t,n,r,i){return{x:t+Math.cos(-cy*i)*r,y:n+Math.sin(-cy*i)*r}},I4=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},hme=function(t,n,r,i,o){var s=t.width,a=t.height,l=t.startAngle,u=t.endAngle,c=In(t.cx,s,s/2),f=In(t.cy,a,a/2),h=I4(s,a,r),d=In(t.innerRadius,h,0),p=In(t.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(y,g){var v=n[g],x=v.domain,k=v.reversed,w;if(we(v.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[d,p]),k&&(w=[w[1],w[0]]);else{w=v.range;var S=w,O=sme(S,2);l=O[0],u=O[1]}var A=A4(v,o),P=A.realScaleType,M=A.scale;M.domain(x).range(w),P4(M);var _=E4(M,io(io({},v),{},{realScaleType:P})),E=io(io(io({},v),_),{},{range:w,radius:p,realScaleType:P,scale:M,cx:c,cy:f,innerRadius:d,outerRadius:p,startAngle:l,endAngle:u});return io(io({},y),{},M4({},g,E))},{})},dme=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(i-s,2))},pme=function(t,n){var r=t.x,i=t.y,o=n.cx,s=n.cy,a=dme({x:r,y:i},{x:o,y:s});if(a<=0)return{radius:a};var l=(r-o)/a,u=Math.acos(l);return i>s&&(u=2*Math.PI-u),{radius:a,angle:fme(u),angleInRadian:u}},mme=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},gme=function(t,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return t+a*360},TM=function(t,n){var r=t.x,i=t.y,o=pme({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,u=n.outerRadius;if(s<l||s>u)return!1;if(s===0)return!0;var c=mme(n),f=c.startAngle,h=c.endAngle,d=a,p;if(f<=h){for(;d>h;)d-=360;for(;d<f;)d+=360;p=d>=f&&d<=h}else{for(;d>f;)d-=360;for(;d<h;)d+=360;p=d>=h&&d<=f}return p?io(io({},n),{},{radius:s,angle:gme(d,n)}):null},j4=function(t){return!C.isValidElement(t)&&!xe(t)&&typeof t!="boolean"?t.className:""};function Jh(e){"@babel/helpers - typeof";return Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jh(e)}var yme=["offset"];function vme(e){return Sme(e)||wme(e)||xme(e)||bme()}function bme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
286
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xme(e,t){if(e){if(typeof e=="string")return kS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kS(e,t)}}function wme(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sme(e){if(Array.isArray(e))return kS(e)}function kS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kme(e,t){if(e==null)return{};var n=Ome(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ome(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_M(Object(n),!0).forEach(function(r){Cme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cme(e,t,n){return t=Ame(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ame(e){var t=Pme(e,"string");return Jh(t)=="symbol"?t:t+""}function Pme(e,t){if(Jh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ed(){return ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ed.apply(this,arguments)}var Eme=function(t){var n=t.value,r=t.formatter,i=we(t.children)?n:t.children;return xe(r)?r(i):i},Tme=function(t,n){var r=Mn(n-t),i=Math.min(Math.abs(n-t),360);return r*i},_me=function(t,n,r){var i=t.position,o=t.viewBox,s=t.offset,a=t.className,l=o,u=l.cx,c=l.cy,f=l.innerRadius,h=l.outerRadius,d=l.startAngle,p=l.endAngle,m=l.clockWise,y=(f+h)/2,g=Tme(d,p),v=g>=0?1:-1,x,k;i==="insideStart"?(x=d+v*s,k=m):i==="insideEnd"?(x=p-v*s,k=!m):i==="end"&&(x=p+v*s,k=m),k=g<=0?k:!k;var w=ot(u,c,y,x),S=ot(u,c,y,x+(k?1:-1)*359),O="M".concat(w.x,",").concat(w.y,`
287
+ A`).concat(y,",").concat(y,",0,1,").concat(k?0:1,`,
288
+ `).concat(S.x,",").concat(S.y),A=we(t.id)?Ec("recharts-radial-line-"):t.id;return L.createElement("text",ed({},r,{dominantBaseline:"central",className:Se("recharts-radial-bar-label",a)}),L.createElement("defs",null,L.createElement("path",{id:A,d:O})),L.createElement("textPath",{xlinkHref:"#".concat(A)},n))},Mme=function(t){var n=t.viewBox,r=t.offset,i=t.position,o=n,s=o.cx,a=o.cy,l=o.innerRadius,u=o.outerRadius,c=o.startAngle,f=o.endAngle,h=(c+f)/2;if(i==="outside"){var d=ot(s,a,u+r,h),p=d.x,m=d.y;return{x:p,y:m,textAnchor:p>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,g=ot(s,a,y,h),v=g.x,x=g.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Ime=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,o=t.position,s=n,a=s.x,l=s.y,u=s.width,c=s.height,f=c>=0?1:-1,h=f*i,d=f>0?"end":"start",p=f>0?"start":"end",m=u>=0?1:-1,y=m*i,g=m>0?"end":"start",v=m>0?"start":"end";if(o==="top"){var x={x:a+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Lt(Lt({},x),r?{height:Math.max(l-r.y,0),width:u}:{})}if(o==="bottom"){var k={x:a+u/2,y:l+c+h,textAnchor:"middle",verticalAnchor:p};return Lt(Lt({},k),r?{height:Math.max(r.y+r.height-(l+c),0),width:u}:{})}if(o==="left"){var w={x:a-y,y:l+c/2,textAnchor:g,verticalAnchor:"middle"};return Lt(Lt({},w),r?{width:Math.max(w.x-r.x,0),height:c}:{})}if(o==="right"){var S={x:a+u+y,y:l+c/2,textAnchor:v,verticalAnchor:"middle"};return Lt(Lt({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:c}:{})}var O=r?{width:u,height:c}:{};return o==="insideLeft"?Lt({x:a+y,y:l+c/2,textAnchor:v,verticalAnchor:"middle"},O):o==="insideRight"?Lt({x:a+u-y,y:l+c/2,textAnchor:g,verticalAnchor:"middle"},O):o==="insideTop"?Lt({x:a+u/2,y:l+h,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Lt({x:a+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},O):o==="insideTopLeft"?Lt({x:a+y,y:l+h,textAnchor:v,verticalAnchor:p},O):o==="insideTopRight"?Lt({x:a+u-y,y:l+h,textAnchor:g,verticalAnchor:p},O):o==="insideBottomLeft"?Lt({x:a+y,y:l+c-h,textAnchor:v,verticalAnchor:d},O):o==="insideBottomRight"?Lt({x:a+u-y,y:l+c-h,textAnchor:g,verticalAnchor:d},O):Oc(o)&&(ne(o.x)||ya(o.x))&&(ne(o.y)||ya(o.y))?Lt({x:a+In(o.x,u),y:l+In(o.y,c),textAnchor:"end",verticalAnchor:"end"},O):Lt({x:a+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},O)},jme=function(t){return"cx"in t&&ne(t.cx)};function Qt(e){var t=e.offset,n=t===void 0?5:t,r=kme(e,yme),i=Lt({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!o||we(a)&&we(l)&&!C.isValidElement(u)&&!xe(u))return null;if(C.isValidElement(u))return C.cloneElement(u,i);var d;if(xe(u)){if(d=C.createElement(u,i),C.isValidElement(d))return d}else d=Eme(i);var p=jme(o),m=de(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return _me(i,d,m);var y=p?Mme(i):Ime(i);return L.createElement(Ka,ed({className:Se("recharts-label",f)},m,y,{breakAll:h}),d)}Qt.displayName="Label";var R4=function(t){var n=t.cx,r=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,a=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,d=t.top,p=t.left,m=t.width,y=t.height,g=t.clockWise,v=t.labelViewBox;if(v)return v;if(ne(m)&&ne(y)){if(ne(f)&&ne(h))return{x:f,y:h,width:m,height:y};if(ne(d)&&ne(p))return{x:d,y:p,width:m,height:y}}return ne(f)&&ne(h)?{x:f,y:h,width:0,height:0}:ne(n)&&ne(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:u||0,outerRadius:c||l||a||0,clockWise:g}:t.viewBox?t.viewBox:{}},Rme=function(t,n){return t?t===!0?L.createElement(Qt,{key:"label-implicit",viewBox:n}):Ht(t)?L.createElement(Qt,{key:"label-implicit",viewBox:n,value:t}):C.isValidElement(t)?t.type===Qt?C.cloneElement(t,{key:"label-implicit",viewBox:n}):L.createElement(Qt,{key:"label-implicit",content:t,viewBox:n}):xe(t)?L.createElement(Qt,{key:"label-implicit",content:t,viewBox:n}):Oc(t)?L.createElement(Qt,ed({viewBox:n},t,{key:"label-implicit"})):null:null},Nme=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,o=R4(t),s=kr(i,Qt).map(function(l,u){return C.cloneElement(l,{viewBox:n||o,key:"label-".concat(u)})});if(!r)return s;var a=Rme(t.label,n||o);return[a].concat(vme(s))};Qt.parseViewBox=R4;Qt.renderCallByParent=Nme;function Dme(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Lme=Dme;const $me=De(Lme);function td(e){"@babel/helpers - typeof";return td=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},td(e)}var Bme=["valueAccessor"],Fme=["data","dataKey","clockWise","id","textBreakAll"];function zme(e){return Vme(e)||Hme(e)||Ume(e)||Wme()}function Wme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
289
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ume(e,t){if(e){if(typeof e=="string")return OS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OS(e,t)}}function Hme(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vme(e){if(Array.isArray(e))return OS(e)}function OS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fy(){return fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fy.apply(this,arguments)}function MM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MM(Object(n),!0).forEach(function(r){qme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qme(e,t,n){return t=Kme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kme(e){var t=Gme(e,"string");return td(t)=="symbol"?t:t+""}function Gme(e,t){if(td(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(td(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jM(e,t){if(e==null)return{};var n=Qme(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qme(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Xme=function(t){return Array.isArray(t.value)?$me(t.value):t.value};function xo(e){var t=e.valueAccessor,n=t===void 0?Xme:t,r=jM(e,Bme),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,u=jM(r,Fme);return!i||!i.length?null:L.createElement(je,{className:"recharts-label-list"},i.map(function(c,f){var h=we(o)?n(c,f):zt(c&&c.payload,o),d=we(a)?{}:{id:"".concat(a,"-").concat(f)};return L.createElement(Qt,fy({},de(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:Qt.parseViewBox(we(s)?c:IM(IM({},c),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}xo.displayName="LabelList";function Yme(e,t){return e?e===!0?L.createElement(xo,{key:"labelList-implicit",data:t}):L.isValidElement(e)||xe(e)?L.createElement(xo,{key:"labelList-implicit",data:t,content:e}):Oc(e)?L.createElement(xo,fy({data:t},e,{key:"labelList-implicit"})):null:null}function Zme(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=kr(r,xo).map(function(s,a){return C.cloneElement(s,{data:t,key:"labelList-".concat(a)})});if(!n)return i;var o=Yme(e.label,t);return[o].concat(zme(i))}xo.renderCallByParent=Zme;function nd(e){"@babel/helpers - typeof";return nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nd(e)}function CS(){return CS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CS.apply(this,arguments)}function RM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RM(Object(n),!0).forEach(function(r){Jme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jme(e,t,n){return t=ege(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ege(e){var t=tge(e,"string");return nd(t)=="symbol"?t:t+""}function tge(e,t){if(nd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nge=function(t,n){var r=Mn(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},Vp=function(t){var n=t.cx,r=t.cy,i=t.radius,o=t.angle,s=t.sign,a=t.isExternal,l=t.cornerRadius,u=t.cornerIsExternal,c=l*(a?1:-1)+i,f=Math.asin(l/c)/cy,h=u?o:o+s*f,d=ot(n,r,c,h),p=ot(n,r,i,h),m=u?o-s*f:o,y=ot(n,r,c*Math.cos(f*cy),m);return{center:d,circleTangency:p,lineTangency:y,theta:f}},N4=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.startAngle,a=t.endAngle,l=nge(s,a),u=s+l,c=ot(n,r,o,s),f=ot(n,r,o,u),h="M ".concat(c.x,",").concat(c.y,`
290
+ A `).concat(o,",").concat(o,`,0,
291
+ `).concat(+(Math.abs(l)>180),",").concat(+(s>u),`,
292
+ `).concat(f.x,",").concat(f.y,`
293
+ `);if(i>0){var d=ot(n,r,i,s),p=ot(n,r,i,u);h+="L ".concat(p.x,",").concat(p.y,`
294
+ A `).concat(i,",").concat(i,`,0,
295
+ `).concat(+(Math.abs(l)>180),",").concat(+(s<=u),`,
296
+ `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},rge=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,a=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,f=Mn(c-u),h=Vp({cx:n,cy:r,radius:o,angle:u,sign:f,cornerRadius:s,cornerIsExternal:l}),d=h.circleTangency,p=h.lineTangency,m=h.theta,y=Vp({cx:n,cy:r,radius:o,angle:c,sign:-f,cornerRadius:s,cornerIsExternal:l}),g=y.circleTangency,v=y.lineTangency,x=y.theta,k=l?Math.abs(u-c):Math.abs(u-c)-m-x;if(k<0)return a?"M ".concat(p.x,",").concat(p.y,`
297
+ a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
298
+ a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
299
+ `):N4({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:u,endAngle:c});var w="M ".concat(p.x,",").concat(p.y,`
300
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,`
301
+ A`).concat(o,",").concat(o,",0,").concat(+(k>180),",").concat(+(f<0),",").concat(g.x,",").concat(g.y,`
302
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
303
+ `);if(i>0){var S=Vp({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),O=S.circleTangency,A=S.lineTangency,P=S.theta,M=Vp({cx:n,cy:r,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),_=M.circleTangency,E=M.lineTangency,R=M.theta,N=l?Math.abs(u-c):Math.abs(u-c)-P-R;if(N<0&&s===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(E.x,",").concat(E.y,`
304
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,`
305
+ A`).concat(i,",").concat(i,",0,").concat(+(N>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,`
306
+ A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},ige={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},D4=function(t){var n=NM(NM({},ige),t),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,u=n.cornerIsExternal,c=n.startAngle,f=n.endAngle,h=n.className;if(s<o||c===f)return null;var d=Se("recharts-sector",h),p=s-o,m=In(a,p,0,!0),y;return m>0&&Math.abs(c-f)<360?y=rge({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):y=N4({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:c,endAngle:f}),L.createElement("path",CS({},de(n,!0),{className:d,d:y,role:"img"}))};function rd(e){"@babel/helpers - typeof";return rd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rd(e)}function AS(){return AS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AS.apply(this,arguments)}function DM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DM(Object(n),!0).forEach(function(r){oge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oge(e,t,n){return t=sge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sge(e){var t=age(e,"string");return rd(t)=="symbol"?t:t+""}function age(e,t){if(rd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $M={curveBasisClosed:ite,curveBasisOpen:ote,curveBasis:rte,curveBumpX:Uee,curveBumpY:Hee,curveLinearClosed:ste,curveLinear:u0,curveMonotoneX:ate,curveMonotoneY:lte,curveNatural:ute,curveStep:cte,curveStepAfter:hte,curveStepBefore:fte},qp=function(t){return t.x===+t.x&&t.y===+t.y},ff=function(t){return t.x},hf=function(t){return t.y},lge=function(t,n){if(xe(t))return t;var r="curve".concat(a0(t));return(r==="curveMonotone"||r==="curveBump")&&n?$M["".concat(r).concat(n==="vertical"?"Y":"X")]:$M[r]||u0},uge=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,o=i===void 0?[]:i,s=t.baseLine,a=t.layout,l=t.connectNulls,u=l===void 0?!1:l,c=lge(r,a),f=u?o.filter(function(m){return qp(m)}):o,h;if(Array.isArray(s)){var d=u?s.filter(function(m){return qp(m)}):s,p=f.map(function(m,y){return LM(LM({},m),{},{base:d[y]})});return a==="vertical"?h=Dp().y(hf).x1(ff).x0(function(m){return m.base.x}):h=Dp().x(ff).y1(hf).y0(function(m){return m.base.y}),h.defined(qp).curve(c),h(p)}return a==="vertical"&&ne(s)?h=Dp().y(hf).x1(ff).x0(s):ne(s)?h=Dp().x(ff).y1(hf).y0(s):h=IF().x(ff).y(hf),h.defined(qp).curve(c),h(f)},hy=function(t){var n=t.className,r=t.points,i=t.path,o=t.pathRef;if((!r||!r.length)&&!i)return null;var s=r&&r.length?uge(t):i;return C.createElement("path",AS({},de(t,!1),Ng(t),{className:Se("recharts-curve",n),d:s,ref:o}))},L4={exports:{}},cge="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",fge=cge,hge=fge;function $4(){}function B4(){}B4.resetWarningCache=$4;var dge=function(){function e(r,i,o,s,a,l){if(l!==hge){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:B4,resetWarningCache:$4};return n.PropTypes=n,n};L4.exports=dge();var pge=L4.exports;const Le=De(pge),{getOwnPropertyNames:mge,getOwnPropertySymbols:gge}=Object,{hasOwnProperty:yge}=Object.prototype;function Sx(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Kp(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:o}=i,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);const l=e(n,r,i);return o.delete(n),o.delete(r),l}}function vge(e){return e?.[Symbol.toStringTag]}function BM(e){return mge(e).concat(gge(e))}const bge=Object.hasOwn||((e,t)=>yge.call(e,t));function ul(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const xge="__v",wge="__o",Sge="_owner",{getOwnPropertyDescriptor:FM,keys:zM}=Object;function kge(e,t){return e.byteLength===t.byteLength&&dy(new Uint8Array(e),new Uint8Array(t))}function Oge(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Cge(e,t){return e.byteLength===t.byteLength&&dy(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Age(e,t){return ul(e.getTime(),t.getTime())}function Pge(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ege(e,t){return e===t}function WM(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.entries();let s,a,l=0;for(;(s=o.next())&&!s.done;){const u=t.entries();let c=!1,f=0;for(;(a=u.next())&&!a.done;){if(i[f]){f++;continue}const h=s.value,d=a.value;if(n.equals(h[0],d[0],l,f,e,t,n)&&n.equals(h[1],d[1],h[0],d[0],e,t,n)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}const Tge=ul;function _ge(e,t,n){const r=zM(e);let i=r.length;if(zM(t).length!==i)return!1;for(;i-- >0;)if(!F4(e,t,n,r[i]))return!1;return!0}function df(e,t,n){const r=BM(e);let i=r.length;if(BM(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!F4(e,t,n,o)||(s=FM(e,o),a=FM(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function Mge(e,t){return ul(e.valueOf(),t.valueOf())}function Ige(e,t){return e.source===t.source&&e.flags===t.flags}function UM(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),o=e.values();let s,a;for(;(s=o.next())&&!s.done;){const l=t.values();let u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function dy(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function jge(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function F4(e,t,n,r){return(r===Sge||r===wge||r===xge)&&(e.$$typeof||t.$$typeof)?!0:bge(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Rge="[object ArrayBuffer]",Nge="[object Arguments]",Dge="[object Boolean]",Lge="[object DataView]",$ge="[object Date]",Bge="[object Error]",Fge="[object Map]",zge="[object Number]",Wge="[object Object]",Uge="[object RegExp]",Hge="[object Set]",Vge="[object String]",qge={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Kge="[object URL]",Gge=Object.prototype.toString;function Qge({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:p}){return function(y,g,v){if(y===g)return!0;if(y==null||g==null)return!1;const x=typeof y;if(x!==typeof g)return!1;if(x!=="object")return x==="number"?a(y,g,v):x==="function"?o(y,g,v):!1;const k=y.constructor;if(k!==g.constructor)return!1;if(k===Object)return l(y,g,v);if(Array.isArray(y))return t(y,g,v);if(k===Date)return r(y,g,v);if(k===RegExp)return c(y,g,v);if(k===Map)return s(y,g,v);if(k===Set)return f(y,g,v);const w=Gge.call(y);if(w===$ge)return r(y,g,v);if(w===Uge)return c(y,g,v);if(w===Fge)return s(y,g,v);if(w===Hge)return f(y,g,v);if(w===Wge)return typeof y.then!="function"&&typeof g.then!="function"&&l(y,g,v);if(w===Kge)return d(y,g,v);if(w===Bge)return i(y,g,v);if(w===Nge)return l(y,g,v);if(qge[w])return h(y,g,v);if(w===Rge)return e(y,g,v);if(w===Lge)return n(y,g,v);if(w===Dge||w===zge||w===Vge)return u(y,g,v);if(p){let S=p[w];if(!S){const O=vge(y);O&&(S=p[O])}if(S)return S(y,g,v)}return!1}}function Xge({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:kge,areArraysEqual:n?df:Oge,areDataViewsEqual:Cge,areDatesEqual:Age,areErrorsEqual:Pge,areFunctionsEqual:Ege,areMapsEqual:n?Sx(WM,df):WM,areNumbersEqual:Tge,areObjectsEqual:n?df:_ge,arePrimitiveWrappersEqual:Mge,areRegExpsEqual:Ige,areSetsEqual:n?Sx(UM,df):UM,areTypedArraysEqual:n?Sx(dy,df):dy,areUrlsEqual:jge,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Kp(r.areArraysEqual),o=Kp(r.areMapsEqual),s=Kp(r.areObjectsEqual),a=Kp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function Yge(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function Zge({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,l){const{cache:u=e?new WeakMap:void 0,meta:c}=n();return t(a,l,{cache:u,equals:r,meta:c,strict:i})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return t(a,l,o)}}const Jge=Us();Us({strict:!0});Us({circular:!0});Us({circular:!0,strict:!0});Us({createInternalComparator:()=>ul});Us({strict:!0,createInternalComparator:()=>ul});Us({circular:!0,createInternalComparator:()=>ul});Us({circular:!0,createInternalComparator:()=>ul,strict:!0});function Us(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=Xge(e),s=Qge(o),a=n?n(s):Yge(s);return Zge({circular:t,comparator:s,createState:r,equals:a,strict:i})}function eye(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function HM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>t?(e(o),n=-1):eye(i)};requestAnimationFrame(r)}function PS(e){"@babel/helpers - typeof";return PS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PS(e)}function tye(e){return oye(e)||iye(e)||rye(e)||nye()}function nye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
307
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rye(e,t){if(e){if(typeof e=="string")return VM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VM(e,t)}}function VM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oye(e){if(Array.isArray(e))return e}function sye(){var e={},t=function(){return null},n=!1,r=function i(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var s=o,a=tye(s),l=a[0],u=a.slice(1);if(typeof l=="number"){HM(i.bind(null,u),l);return}i(l),HM(i.bind(null,u));return}PS(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function id(e){"@babel/helpers - typeof";return id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},id(e)}function qM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qM(Object(n),!0).forEach(function(r){z4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z4(e,t,n){return t=aye(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aye(e){var t=lye(e,"string");return id(t)==="symbol"?t:String(t)}function lye(e,t){if(id(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(id(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uye=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(o){return i.includes(o)})})},cye=function(t){return t},fye=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Gf=function(t,n){return Object.keys(n).reduce(function(r,i){return KM(KM({},r),{},z4({},i,t(i,n[i])))},{})},GM=function(t,n,r){return t.map(function(i){return"".concat(fye(i)," ").concat(n,"ms ").concat(r)}).join(",")};function hye(e,t){return mye(e)||pye(e,t)||W4(e,t)||dye()}function dye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
308
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pye(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function mye(e){if(Array.isArray(e))return e}function gye(e){return bye(e)||vye(e)||W4(e)||yye()}function yye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W4(e,t){if(e){if(typeof e=="string")return ES(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ES(e,t)}}function vye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bye(e){if(Array.isArray(e))return ES(e)}function ES(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var py=1e-4,U4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},H4=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},QM=function(t,n){return function(r){var i=U4(t,n);return H4(i,r)}},xye=function(t,n){return function(r){var i=U4(t,n),o=[].concat(gye(i.map(function(s,a){return s*a}).slice(1)),[0]);return H4(o,r)}},XM=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],o=n[1],s=n[2],a=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,o=0,s=1,a=1;break;case"ease":i=.25,o=.1,s=.25,a=1;break;case"ease-in":i=.42,o=0,s=1,a=1;break;case"ease-out":i=.42,o=0,s=.58,a=1;break;case"ease-in-out":i=0,o=0,s=.58,a=1;break;default:{var l=n[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var u=l[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),c=hye(u,4);i=c[0],o=c[1],s=c[2],a=c[3]}}}var f=QM(i,s),h=QM(o,a),d=xye(i,s),p=function(g){return g>1?1:g<0?0:g},m=function(g){for(var v=g>1?1:g,x=v,k=0;k<8;++k){var w=f(x)-v,S=d(x);if(Math.abs(w-v)<py||S<py)return h(x);x=p(x-w/S)}return h(x)};return m.isStepper=!1,m},wye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,o=i===void 0?8:i,s=t.dt,a=s===void 0?17:s,l=function(c,f,h){var d=-(c-f)*r,p=h*o,m=h+(d-p)*a/1e3,y=h*a/1e3+c;return Math.abs(y-f)<py&&Math.abs(m)<py?[f,0]:[y,m]};return l.isStepper=!0,l.dt=a,l},Sye=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return XM(i);case"spring":return wye();default:if(i.split("(")[0]==="cubic-bezier")return XM(i)}return typeof i=="function"?i:null};function od(e){"@babel/helpers - typeof";return od=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},od(e)}function YM(e){return Cye(e)||Oye(e)||V4(e)||kye()}function kye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
310
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cye(e){if(Array.isArray(e))return _S(e)}function ZM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZM(Object(n),!0).forEach(function(r){TS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TS(e,t,n){return t=Aye(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aye(e){var t=Pye(e,"string");return od(t)==="symbol"?t:String(t)}function Pye(e,t){if(od(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(od(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eye(e,t){return Mye(e)||_ye(e,t)||V4(e,t)||Tye()}function Tye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
311
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V4(e,t){if(e){if(typeof e=="string")return _S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _S(e,t)}}function _S(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _ye(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Mye(e){if(Array.isArray(e))return e}var my=function(t,n,r){return t+(n-t)*r},MS=function(t){var n=t.from,r=t.to;return n!==r},Iye=function e(t,n,r){var i=Gf(function(o,s){if(MS(s)){var a=t(s.from,s.to,s.velocity),l=Eye(a,2),u=l[0],c=l[1];return rn(rn({},s),{},{from:u,velocity:c})}return s},n);return r<1?Gf(function(o,s){return MS(s)?rn(rn({},s),{},{velocity:my(s.velocity,i[o].velocity,r),from:my(s.from,i[o].from,r)}):s},n):e(t,i,r-1)};const jye=function(e,t,n,r,i){var o=uye(e,t),s=o.reduce(function(y,g){return rn(rn({},y),{},TS({},g,[e[g],t[g]]))},{}),a=o.reduce(function(y,g){return rn(rn({},y),{},TS({},g,{from:e[g],velocity:0,to:t[g]}))},{}),l=-1,u,c,f=function(){return null},h=function(){return Gf(function(g,v){return v.from},a)},d=function(){return!Object.values(a).filter(MS).length},p=function(g){u||(u=g);var v=g-u,x=v/n.dt;a=Iye(n,a,x),i(rn(rn(rn({},e),t),h())),u=g,d()||(l=requestAnimationFrame(f))},m=function(g){c||(c=g);var v=(g-c)/r,x=Gf(function(w,S){return my.apply(void 0,YM(S).concat([n(v)]))},s);if(i(rn(rn(rn({},e),t),x)),v<1)l=requestAnimationFrame(f);else{var k=Gf(function(w,S){return my.apply(void 0,YM(S).concat([n(1)]))},s);i(rn(rn(rn({},e),t),k))}};return f=n.isStepper?p:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(l)}}};function Vu(e){"@babel/helpers - typeof";return Vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vu(e)}var Rye=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Nye(e,t){if(e==null)return{};var n=Dye(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dye(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function kx(e){return Fye(e)||Bye(e)||$ye(e)||Lye()}function Lye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ye(e,t){if(e){if(typeof e=="string")return IS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IS(e,t)}}function Bye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fye(e){if(Array.isArray(e))return IS(e)}function IS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JM(Object(n),!0).forEach(function(r){_f(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _f(e,t,n){return t=q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wye(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,q4(r.key),r)}}function Uye(e,t,n){return t&&Wye(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function q4(e){var t=Hye(e,"string");return Vu(t)==="symbol"?t:String(t)}function Hye(e,t){if(Vu(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vye(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jS(e,t)}function jS(e,t){return jS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jS(e,t)}function qye(e){var t=Kye();return function(){var r=gy(e),i;if(t){var o=gy(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return RS(this,i)}}function RS(e,t){if(t&&(Vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NS(e)}function NS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kye(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gy(e){return gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gy(e)}var Ki=function(e){Vye(n,e);var t=qye(n);function n(r,i){var o;zye(this,n),o=t.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,u=s.from,c=s.to,f=s.steps,h=s.children,d=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(NS(o)),o.changeStyle=o.changeStyle.bind(NS(o)),!a||d<=0)return o.state={style:{}},typeof h=="function"&&(o.state={style:c}),RS(o);if(f&&f.length)o.state={style:f[0].style};else if(u){if(typeof h=="function")return o.state={style:u},RS(o);o.state={style:l?_f({},l,u):u}}else o.state={style:{}};return o}return Uye(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,u=o.shouldReAnimate,c=o.to,f=o.from,h=this.state.style;if(a){if(!s){var d={style:l?_f({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(Jge(i.to,c)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||u?f:i.to;if(this.state&&h){var y={style:l?_f({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(ei(ei({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,a=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=jye(s,a,Sye(u),l,this.changeStyle),p=function(){o.stopJSAnimation=d()};this.manager.start([h,c,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,a=i.begin,l=i.onAnimationStart,u=s[0],c=u.style,f=u.duration,h=f===void 0?0:f,d=function(m,y,g){if(g===0)return m;var v=y.duration,x=y.easing,k=x===void 0?"ease":x,w=y.style,S=y.properties,O=y.onAnimationEnd,A=g>0?s[g-1]:y,P=S||Object.keys(w);if(typeof k=="function"||k==="spring")return[].concat(kx(m),[o.runJSAnimation.bind(o,{from:A.style,to:w,duration:v,easing:k}),v]);var M=GM(P,v,k),_=ei(ei(ei({},A.style),w),{},{transition:M});return[].concat(kx(m),[_,v,O]).filter(cye)};return this.manager.start([l].concat(kx(s.reduce(d,[c,Math.max(h,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=sye());var o=i.begin,s=i.duration,a=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof d=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=a?_f({},a,l):l,y=GM(Object.keys(m),s,u);p.start([c,o,ei(ei({},m),{},{transition:y}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Nye(i,Rye),u=C.Children.count(o),c=this.state.style;if(typeof o=="function")return o(c);if(!a||u===0||s<=0)return o;var f=function(d){var p=d.props,m=p.style,y=m===void 0?{}:m,g=p.className,v=C.cloneElement(d,ei(ei({},l),{},{style:ei(ei({},y),c),className:g}));return v};return u===1?f(C.Children.only(o)):L.createElement("div",null,C.Children.map(o,function(h){return f(h)}))}}]),n}(C.PureComponent);Ki.displayName="Animate";Ki.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ki.propTypes={from:Le.oneOfType([Le.object,Le.string]),to:Le.oneOfType([Le.object,Le.string]),attributeName:Le.string,duration:Le.number,begin:Le.number,easing:Le.oneOfType([Le.string,Le.func]),steps:Le.arrayOf(Le.shape({duration:Le.number.isRequired,style:Le.object.isRequired,easing:Le.oneOfType([Le.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Le.func]),properties:Le.arrayOf("string"),onAnimationEnd:Le.func})),children:Le.oneOfType([Le.node,Le.func]),isActive:Le.bool,canBegin:Le.bool,onAnimationEnd:Le.func,shouldReAnimate:Le.bool,onAnimationStart:Le.func,onAnimationReStart:Le.func};function DS(){return DS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DS.apply(null,arguments)}function Gye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function sd(e){"@babel/helpers - typeof";return sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sd(e)}function yy(){return yy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yy.apply(this,arguments)}function Qye(e,t){return Jye(e)||Zye(e,t)||Yye(e,t)||Xye()}function Xye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
313
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yye(e,t){if(e){if(typeof e=="string")return eI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eI(e,t)}}function eI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zye(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Jye(e){if(Array.isArray(e))return e}function tI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(r){eve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eve(e,t,n){return t=tve(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tve(e){var t=nve(e,"string");return sd(t)=="symbol"?t:t+""}function nve(e,t){if(sd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rI=function(t,n,r,i,o){var s=Math.min(Math.abs(r)/2,Math.abs(i)/2),a=i>=0?1:-1,l=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,c;if(s>0&&o instanceof Array){for(var f=[0,0,0,0],h=0,d=4;h<d;h++)f[h]=o[h]>s?s:o[h];c="M".concat(t,",").concat(n+a*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(n)),c+="L ".concat(t+r-l*f[1],",").concat(n),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
314
+ `).concat(t+r,",").concat(n+a*f[1])),c+="L ".concat(t+r,",").concat(n+i-a*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
315
+ `).concat(t+r-l*f[2],",").concat(n+i)),c+="L ".concat(t+l*f[3],",").concat(n+i),f[3]>0&&(c+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
316
+ `).concat(t,",").concat(n+i-a*f[3])),c+="Z"}else if(s>0&&o===+o&&o>0){var p=Math.min(s,o);c="M ".concat(t,",").concat(n+a*p,`
317
+ A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+l*p,",").concat(n,`
318
+ L `).concat(t+r-l*p,",").concat(n,`
319
+ A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r,",").concat(n+a*p,`
320
+ L `).concat(t+r,",").concat(n+i-a*p,`
321
+ A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r-l*p,",").concat(n+i,`
322
+ L `).concat(t+l*p,",").concat(n+i,`
323
+ A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t,",").concat(n+i-a*p," Z")}else c="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return c},rve=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,o=n.x,s=n.y,a=n.width,l=n.height;if(Math.abs(a)>0&&Math.abs(l)>0){var u=Math.min(o,o+a),c=Math.max(o,o+a),f=Math.min(s,s+l),h=Math.max(s,s+l);return r>=u&&r<=c&&i>=f&&i<=h}return!1},ive={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},LA=function(t){var n=nI(nI({},ive),t),r=C.useRef(),i=C.useState(-1),o=Qye(i,2),s=o[0],a=o[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&a(k)}catch{}},[]);var l=n.x,u=n.y,c=n.width,f=n.height,h=n.radius,d=n.className,p=n.animationEasing,m=n.animationDuration,y=n.animationBegin,g=n.isAnimationActive,v=n.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var x=Se("recharts-rectangle",d);return v?L.createElement(Ki,{canBegin:s>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:m,animationEasing:p,isActive:v},function(k){var w=k.width,S=k.height,O=k.x,A=k.y;return L.createElement(Ki,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:g,easing:p},L.createElement("path",yy({},de(n,!0),{className:x,d:rI(O,A,w,S,h),ref:r})))}):L.createElement("path",yy({},de(n,!0),{className:x,d:rI(l,u,c,f,h)}))},ove=["points","className","baseLinePoints","connectNulls"];function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gl.apply(this,arguments)}function sve(e,t){if(e==null)return{};var n=ave(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ave(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function iI(e){return fve(e)||cve(e)||uve(e)||lve()}function lve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
324
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uve(e,t){if(e){if(typeof e=="string")return LS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LS(e,t)}}function cve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fve(e){if(Array.isArray(e))return LS(e)}function LS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var oI=function(t){return t&&t.x===+t.x&&t.y===+t.y},hve=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){oI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),oI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Qf=function(t,n){var r=hve(t);n&&(r=[r.reduce(function(o,s){return[].concat(iI(o),iI(s))},[])]);var i=r.map(function(o){return o.reduce(function(s,a,l){return"".concat(s).concat(l===0?"M":"L").concat(a.x,",").concat(a.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},dve=function(t,n,r){var i=Qf(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Qf(n.reverse(),r).slice(1))},pve=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,o=t.connectNulls,s=sve(t,ove);if(!n||!n.length)return null;var a=Se("recharts-polygon",r);if(i&&i.length){var l=s.stroke&&s.stroke!=="none",u=dve(n,i,o);return L.createElement("g",{className:a},L.createElement("path",Gl({},de(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),l?L.createElement("path",Gl({},de(s,!0),{fill:"none",d:Qf(n,o)})):null,l?L.createElement("path",Gl({},de(s,!0),{fill:"none",d:Qf(i,o)})):null)}var c=Qf(n,o);return L.createElement("path",Gl({},de(s,!0),{fill:c.slice(-1)==="Z"?s.fill:"none",className:a,d:c}))};function $S(){return $S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$S.apply(this,arguments)}var C0=function(t){var n=t.cx,r=t.cy,i=t.r,o=t.className,s=Se("recharts-dot",o);return n===+n&&r===+r&&i===+i?C.createElement("circle",$S({},de(t,!1),Ng(t),{className:s,cx:n,cy:r,r:i})):null};function ad(e){"@babel/helpers - typeof";return ad=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ad(e)}var mve=["x","y","top","left","width","height","className"];function BS(){return BS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},BS.apply(this,arguments)}function sI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){yve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yve(e,t,n){return t=vve(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vve(e){var t=bve(e,"string");return ad(t)=="symbol"?t:t+""}function bve(e,t){if(ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xve(e,t){if(e==null)return{};var n=wve(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wve(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Sve=function(t,n,r,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},kve=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,o=i===void 0?0:i,s=t.top,a=s===void 0?0:s,l=t.left,u=l===void 0?0:l,c=t.width,f=c===void 0?0:c,h=t.height,d=h===void 0?0:h,p=t.className,m=xve(t,mve),y=gve({x:r,y:o,top:a,left:u,width:f,height:d},m);return!ne(r)||!ne(o)||!ne(f)||!ne(d)||!ne(a)||!ne(u)?null:L.createElement("path",BS({},de(y,!0),{className:Se("recharts-cross",p),d:Sve(r,o,f,d,a,u)}))},Ove=x0,Cve=o4,Ave=Fs;function Pve(e,t){return e&&e.length?Ove(e,Ave(t),Cve):void 0}var Eve=Pve;const Tve=De(Eve);var _ve=x0,Mve=Fs,Ive=s4;function jve(e,t){return e&&e.length?_ve(e,Mve(t),Ive):void 0}var Rve=jve;const Nve=De(Rve);var Dve=["cx","cy","angle","ticks","axisLine"],Lve=["ticks","tick","angle","tickFormatter","stroke"];function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function Xf(){return Xf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xf.apply(this,arguments)}function aI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ys(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aI(Object(n),!0).forEach(function(r){A0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lI(e,t){if(e==null)return{};var n=$ve(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $ve(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Bve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G4(r.key),r)}}function Fve(e,t,n){return t&&uI(e.prototype,t),n&&uI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zve(e,t,n){return t=vy(t),Wve(e,K4()?Reflect.construct(t,n||[],vy(e).constructor):t.apply(e,n))}function Wve(e,t){if(t&&(qu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uve(e)}function Uve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K4=function(){return!!e})()}function vy(e){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vy(e)}function Hve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&FS(e,t)}function FS(e,t){return FS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},FS(e,t)}function A0(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=Vve(e,"string");return qu(t)=="symbol"?t:t+""}function Vve(e,t){if(qu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var P0=function(e){function t(){return Bve(this,t),zve(this,t,arguments)}return Hve(t,e),Fve(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,o=this.props,s=o.angle,a=o.cx,l=o.cy;return ot(a,l,i,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,a=r.ticks,l=Tve(a,function(c){return c.coordinate||0}),u=Nve(a,function(c){return c.coordinate||0});return{cx:i,cy:o,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.angle,a=r.ticks,l=r.axisLine,u=lI(r,Dve),c=a.reduce(function(p,m){return[Math.min(p[0],m.coordinate),Math.max(p[1],m.coordinate)]},[1/0,-1/0]),f=ot(i,o,c[0],s),h=ot(i,o,c[1],s),d=Ys(Ys(Ys({},de(u,!1)),{},{fill:"none"},de(l,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return L.createElement("line",Xf({className:"recharts-polar-radius-axis-line"},d))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,a=i.angle,l=i.tickFormatter,u=i.stroke,c=lI(i,Lve),f=this.getTickTextAnchor(),h=de(c,!1),d=de(s,!1),p=o.map(function(m,y){var g=r.getTickValueCoord(m),v=Ys(Ys(Ys(Ys({textAnchor:f,transform:"rotate(".concat(90-a,", ").concat(g.x,", ").concat(g.y,")")},h),{},{stroke:"none",fill:u},d),{},{index:y},g),{},{payload:m});return L.createElement(je,Xf({className:Se("recharts-polar-radius-axis-tick",j4(s)),key:"tick-".concat(m.coordinate)},qa(r.props,m,y)),t.renderTickItem(s,v,l?l(m.value,y):m.value))});return L.createElement(je,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.axisLine,s=r.tick;return!i||!i.length?null:L.createElement(je,{className:Se("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),s&&this.renderTicks(),Qt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return L.isValidElement(r)?s=L.cloneElement(r,i):xe(r)?s=r(i):s=L.createElement(Ka,Xf({},i,{className:"recharts-polar-radius-axis-tick-value"}),o),s}}])}(C.PureComponent);A0(P0,"displayName","PolarRadiusAxis");A0(P0,"axisType","radiusAxis");A0(P0,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function sa(){return sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sa.apply(this,arguments)}function cI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){E0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,X4(r.key),r)}}function Kve(e,t,n){return t&&fI(e.prototype,t),n&&fI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gve(e,t,n){return t=by(t),Qve(e,Q4()?Reflect.construct(t,n||[],by(e).constructor):t.apply(e,n))}function Qve(e,t){if(t&&(Ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xve(e)}function Xve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q4=function(){return!!e})()}function by(e){return by=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},by(e)}function Yve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zS(e,t)}function zS(e,t){return zS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},zS(e,t)}function E0(e,t,n){return t=X4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X4(e){var t=Zve(e,"string");return Ku(t)=="symbol"?t:t+""}function Zve(e,t){if(Ku(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ku(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jve=Math.PI/180,hI=1e-5,T0=function(e){function t(){return qve(this,t),Gve(this,t,arguments)}return Yve(t,e),Kve(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.cx,s=i.cy,a=i.radius,l=i.orientation,u=i.tickSize,c=u||8,f=ot(o,s,a,r.coordinate),h=ot(o,s,a+(l==="inner"?-1:1)*c,r.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,o=Math.cos(-r.coordinate*Jve),s;return o>hI?s=i==="outer"?"start":"end":o<-hI?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,o=r.cy,s=r.radius,a=r.axisLine,l=r.axisLineType,u=Zs(Zs({},de(this.props,!1)),{},{fill:"none"},de(a,!1));if(l==="circle")return L.createElement(C0,sa({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:o,r:s}));var c=this.props.ticks,f=c.map(function(h){return ot(i,o,s,h.coordinate)});return L.createElement(pve,sa({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,o=i.ticks,s=i.tick,a=i.tickLine,l=i.tickFormatter,u=i.stroke,c=de(this.props,!1),f=de(s,!1),h=Zs(Zs({},c),{},{fill:"none"},de(a,!1)),d=o.map(function(p,m){var y=r.getTickLineCoord(p),g=r.getTickTextAnchor(p),v=Zs(Zs(Zs({textAnchor:g},c),{},{stroke:"none",fill:u},f),{},{index:m,payload:p,x:y.x2,y:y.y2});return L.createElement(je,sa({className:Se("recharts-polar-angle-axis-tick",j4(s)),key:"tick-".concat(p.coordinate)},qa(r.props,p,m)),a&&L.createElement("line",sa({className:"recharts-polar-angle-axis-tick-line"},h,y)),s&&t.renderTickItem(s,v,l?l(p.value,m):p.value))});return L.createElement(je,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var r=this.props,i=r.ticks,o=r.radius,s=r.axisLine;return o<=0||!i||!i.length?null:L.createElement(je,{className:Se("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,o){var s;return L.isValidElement(r)?s=L.cloneElement(r,i):xe(r)?s=r(i):s=L.createElement(Ka,sa({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])}(C.PureComponent);E0(T0,"displayName","PolarAngleAxis");E0(T0,"axisType","angleAxis");E0(T0,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var e0e=n3,t0e=e0e(Object.getPrototypeOf,Object),n0e=t0e,r0e=Lo,i0e=n0e,o0e=$o,s0e="[object Object]",a0e=Function.prototype,l0e=Object.prototype,Y4=a0e.toString,u0e=l0e.hasOwnProperty,c0e=Y4.call(Object);function f0e(e){if(!o0e(e)||r0e(e)!=s0e)return!1;var t=i0e(e);if(t===null)return!0;var n=u0e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Y4.call(n)==c0e}var h0e=f0e;const d0e=De(h0e);var p0e=Lo,m0e=$o,g0e="[object Boolean]";function y0e(e){return e===!0||e===!1||m0e(e)&&p0e(e)==g0e}var v0e=y0e;const b0e=De(v0e);function ld(e){"@babel/helpers - typeof";return ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ld(e)}function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xy.apply(this,arguments)}function x0e(e,t){return O0e(e)||k0e(e,t)||S0e(e,t)||w0e()}function w0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
325
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S0e(e,t){if(e){if(typeof e=="string")return dI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dI(e,t)}}function dI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k0e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function O0e(e){if(Array.isArray(e))return e}function pI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pI(Object(n),!0).forEach(function(r){C0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function C0e(e,t,n){return t=A0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A0e(e){var t=P0e(e,"string");return ld(t)=="symbol"?t:t+""}function P0e(e,t){if(ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gI=function(t,n,r,i,o){var s=r-i,a;return a="M ".concat(t,",").concat(n),a+="L ".concat(t+r,",").concat(n),a+="L ".concat(t+r-s/2,",").concat(n+o),a+="L ".concat(t+r-s/2-i,",").concat(n+o),a+="L ".concat(t,",").concat(n," Z"),a},E0e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},T0e=function(t){var n=mI(mI({},E0e),t),r=C.useRef(),i=C.useState(-1),o=x0e(i,2),s=o[0],a=o[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&a(x)}catch{}},[]);var l=n.x,u=n.y,c=n.upperWidth,f=n.lowerWidth,h=n.height,d=n.className,p=n.animationEasing,m=n.animationDuration,y=n.animationBegin,g=n.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||h!==+h||c===0&&f===0||h===0)return null;var v=Se("recharts-trapezoid",d);return g?L.createElement(Ki,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:h,x:l,y:u},duration:m,animationEasing:p,isActive:g},function(x){var k=x.upperWidth,w=x.lowerWidth,S=x.height,O=x.x,A=x.y;return L.createElement(Ki,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:p},L.createElement("path",xy({},de(n,!0),{className:v,d:gI(O,A,k,w,S),ref:r})))}):L.createElement("g",null,L.createElement("path",xy({},de(n,!0),{className:v,d:gI(l,u,c,f,h)})))},_0e=["option","shapeType","propTransformer","activeClassName","isActive"];function ud(e){"@babel/helpers - typeof";return ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ud(e)}function M0e(e,t){if(e==null)return{};var n=I0e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function I0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){j0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j0e(e,t,n){return t=R0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R0e(e){var t=N0e(e,"string");return ud(t)=="symbol"?t:t+""}function N0e(e,t){if(ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D0e(e,t){return wy(wy({},t),e)}function L0e(e,t){return e==="symbols"}function vI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return L.createElement(LA,n);case"trapezoid":return L.createElement(T0e,n);case"sector":return L.createElement(D4,n);case"symbols":if(L0e(t))return L.createElement(tA,n);break;default:return null}}function $0e(e){return C.isValidElement(e)?e.props:e}function Z4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?D0e:r,o=e.activeClassName,s=o===void 0?"recharts-active-shape":o,a=e.isActive,l=M0e(e,_0e),u;if(C.isValidElement(t))u=C.cloneElement(t,wy(wy({},l),$0e(t)));else if(xe(t))u=t(l);else if(d0e(t)&&!b0e(t)){var c=i(t,l);u=L.createElement(vI,{shapeType:n,elementProps:c})}else{var f=l;u=L.createElement(vI,{shapeType:n,elementProps:f})}return a?L.createElement(je,{className:s},u):u}function _0(e,t){return t!=null&&"trapezoids"in e.props}function M0(e,t){return t!=null&&"sectors"in e.props}function cd(e,t){return t!=null&&"points"in e.props}function B0e(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,o=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&o}function F0e(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function z0e(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function W0e(e,t){var n;return _0(e,t)?n=B0e:M0(e,t)?n=F0e:cd(e,t)&&(n=z0e),n}function U0e(e,t){var n;return _0(e,t)?n="trapezoids":M0(e,t)?n="sectors":cd(e,t)&&(n="points"),n}function H0e(e,t){if(_0(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(M0(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return cd(e,t)?t.payload:{}}function V0e(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=U0e(n,t),o=H0e(n,t),s=r.filter(function(l,u){var c=Jd(o,l),f=n.props[i].filter(function(p){var m=W0e(n,t);return m(p,t)}),h=n.props[i].indexOf(f[f.length-1]),d=u===h;return c&&d}),a=r.indexOf(s[s.length-1]);return a}var Wm;function Gu(e){"@babel/helpers - typeof";return Gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gu(e)}function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ql.apply(this,arguments)}function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){Dr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ez(r.key),r)}}function K0e(e,t,n){return t&&xI(e.prototype,t),n&&xI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function G0e(e,t,n){return t=Sy(t),Q0e(e,J4()?Reflect.construct(t,n||[],Sy(e).constructor):t.apply(e,n))}function Q0e(e,t){if(t&&(Gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X0e(e)}function X0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(J4=function(){return!!e})()}function Sy(e){return Sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sy(e)}function Y0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WS(e,t)}function WS(e,t){return WS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},WS(e,t)}function Dr(e,t,n){return t=ez(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ez(e){var t=Z0e(e,"string");return Gu(t)=="symbol"?t:t+""}function Z0e(e,t){if(Gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Fo=function(e){function t(n){var r;return q0e(this,t),r=G0e(this,t,[n]),Dr(r,"pieRef",null),Dr(r,"sectorRefs",[]),Dr(r,"id",Ec("recharts-pie-")),Dr(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),xe(i)&&i()}),Dr(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),xe(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Y0e(t,e),K0e(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.label,a=o.labelLine,l=o.dataKey,u=o.valueKey,c=de(this.props,!1),f=de(s,!1),h=de(a,!1),d=s&&s.offsetRadius||20,p=r.map(function(m,y){var g=(m.startAngle+m.endAngle)/2,v=ot(m.cx,m.cy,m.outerRadius+d,g),x=Je(Je(Je(Je({},c),m),{},{stroke:"none"},f),{},{index:y,textAnchor:t.getTextAnchor(v.x,m.cx)},v),k=Je(Je(Je(Je({},c),m),{},{fill:"none",stroke:m.fill},h),{},{index:y,points:[ot(m.cx,m.cy,m.outerRadius,g),v]}),w=l;return we(l)&&we(u)?w="value":we(l)&&(w=u),L.createElement(je,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(y)},a&&t.renderLabelLineItem(a,k,"line"),t.renderLabelItem(s,x,zt(m,w)))});return L.createElement(je,{className:"recharts-pie-labels"},p)}},{key:"renderSectorsStatically",value:function(r){var i=this,o=this.props,s=o.activeShape,a=o.blendStroke,l=o.inactiveShape;return r.map(function(u,c){if(u?.startAngle===0&&u?.endAngle===0&&r.length!==1)return null;var f=i.isActiveIndex(c),h=l&&i.hasActiveIndex()?l:null,d=f?s:h,p=Je(Je({},u),{},{stroke:a?u.fill:u.stroke,tabIndex:-1});return L.createElement(je,Ql({ref:function(y){y&&!i.sectorRefs.includes(y)&&i.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},qa(i.props,u,c),{key:"sector-".concat(u?.startAngle,"-").concat(u?.endAngle,"-").concat(u.midAngle,"-").concat(c)}),L.createElement(Z4,Ql({option:d,isActive:f,shapeType:"sector"},p)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,o=i.sectors,s=i.isAnimationActive,a=i.animationBegin,l=i.animationDuration,u=i.animationEasing,c=i.animationId,f=this.state,h=f.prevSectors,d=f.prevIsAnimationActive;return L.createElement(Ki,{begin:a,duration:l,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(p){var m=p.t,y=[],g=o&&o[0],v=g.startAngle;return o.forEach(function(x,k){var w=h&&h[k],S=k>0?Sr(x,"paddingAngle",0):0;if(w){var O=gr(w.endAngle-w.startAngle,x.endAngle-x.startAngle),A=Je(Je({},x),{},{startAngle:v+S,endAngle:v+O(m)+S});y.push(A),v=A.endAngle}else{var P=x.endAngle,M=x.startAngle,_=gr(0,P-M),E=_(m),R=Je(Je({},x),{},{startAngle:v+S,endAngle:v+E+S});y.push(R),v=R.endAngle}}),L.createElement(je,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var a=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[a].focus(),i.setState({sectorToFocus:a});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,o=r.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!Jd(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,o=i.hide,s=i.sectors,a=i.className,l=i.label,u=i.cx,c=i.cy,f=i.innerRadius,h=i.outerRadius,d=i.isAnimationActive,p=this.state.isAnimationFinished;if(o||!s||!s.length||!ne(u)||!ne(c)||!ne(f)||!ne(h))return null;var m=Se("recharts-pie",a);return L.createElement(je,{tabIndex:this.props.rootTabIndex,className:m,ref:function(g){r.pieRef=g}},this.renderSectors(),l&&this.renderLabels(s),Qt.renderCallByParent(this.props,null,!1),(!d||p)&&xo.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,o){if(L.isValidElement(r))return L.cloneElement(r,i);if(xe(r))return r(i);var s=Se("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return L.createElement(hy,Ql({},i,{key:o,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,i,o){if(L.isValidElement(r))return L.cloneElement(r,i);var s=o;if(xe(r)&&(s=r(i),L.isValidElement(s)))return s;var a=Se("recharts-pie-label-text",typeof r!="boolean"&&!xe(r)?r.className:"");return L.createElement(Ka,Ql({},i,{alignmentBaseline:"middle",className:a}),s)}}])}(C.PureComponent);Wm=Fo;Dr(Fo,"displayName","Pie");Dr(Fo,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!sl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Dr(Fo,"parseDeltaAngle",function(e,t){var n=Mn(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Dr(Fo,"getRealPieData",function(e){var t=e.data,n=e.children,r=de(e,!1),i=kr(n,Fu);return t&&t.length?t.map(function(o,s){return Je(Je(Je({payload:o},r),o),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(o){return Je(Je({},r),o.props)}):[]});Dr(Fo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,o=t.height,s=I4(i,o),a=r+In(e.cx,i,i/2),l=n+In(e.cy,o,o/2),u=In(e.innerRadius,s,0),c=In(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(i*i+o*o)/2;return{cx:a,cy:l,innerRadius:u,outerRadius:c,maxRadius:f}});Dr(Fo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?Je(Je({},t.type.defaultProps),t.props):t.props,i=Wm.getRealPieData(r);if(!i||!i.length)return null;var o=r.cornerRadius,s=r.startAngle,a=r.endAngle,l=r.paddingAngle,u=r.dataKey,c=r.nameKey,f=r.valueKey,h=r.tooltipType,d=Math.abs(r.minAngle),p=Wm.parseCoordinateOfPie(r,n),m=Wm.parseDeltaAngle(s,a),y=Math.abs(m),g=u;we(u)&&we(f)?(vo(!1,`Use "dataKey" to specify the value of pie,
326
+ the props "valueKey" will be deprecated in 1.1.0`),g="value"):we(u)&&(vo(!1,`Use "dataKey" to specify the value of pie,
327
+ the props "valueKey" will be deprecated in 1.1.0`),g=f);var v=i.filter(function(A){return zt(A,g,0)!==0}).length,x=(y>=360?v:v-1)*l,k=y-v*d-x,w=i.reduce(function(A,P){var M=zt(P,g,0);return A+(ne(M)?M:0)},0),S;if(w>0){var O;S=i.map(function(A,P){var M=zt(A,g,0),_=zt(A,c,P),E=(ne(M)?M:0)/w,R;P?R=O.endAngle+Mn(m)*l*(M!==0?1:0):R=s;var N=R+Mn(m)*((M!==0?d:0)+E*k),j=(R+N)/2,B=(p.innerRadius+p.outerRadius)/2,F=[{name:_,value:M,payload:A,dataKey:g,type:h}],$=ot(p.cx,p.cy,B,j);return O=Je(Je(Je({percent:E,cornerRadius:o,name:_,tooltipPayload:F,midAngle:j,middleRadius:B,tooltipPosition:$},A),p),{},{value:zt(A,g),startAngle:R,endAngle:N,payload:A,paddingAngle:Mn(m)*l}),O})}return Je(Je({},p),{},{sectors:S,data:i})});var J0e=Math.ceil,ebe=Math.max;function tbe(e,t,n,r){for(var i=-1,o=ebe(J0e((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=e,e+=n;return s}var nbe=tbe,rbe=x3,wI=1/0,ibe=17976931348623157e292;function obe(e){if(!e)return e===0?e:0;if(e=rbe(e),e===wI||e===-wI){var t=e<0?-1:1;return t*ibe}return e===e?e:0}var sbe=obe,abe=nbe,lbe=d0,Ox=sbe;function ube(e){return function(t,n,r){return r&&typeof r!="number"&&lbe(t,n,r)&&(n=r=void 0),t=Ox(t),n===void 0?(n=t,t=0):n=Ox(n),r=r===void 0?t<n?1:-1:Ox(r),abe(t,n,r,e)}}var cbe=ube,fbe=cbe,hbe=fbe(),dbe=hbe;const ky=De(dbe);function fd(e){"@babel/helpers - typeof";return fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fd(e)}function SI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SI(Object(n),!0).forEach(function(r){tz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tz(e,t,n){return t=pbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pbe(e){var t=mbe(e,"string");return fd(t)=="symbol"?t:t+""}function mbe(e,t){if(fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gbe=["Webkit","Moz","O","ms"],ybe=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),i=gbe.reduce(function(o,s){return kI(kI({},o),{},tz({},s+r,n))},{});return i[t]=n,i};function Qu(e){"@babel/helpers - typeof";return Qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(e)}function Oy(){return Oy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oy.apply(this,arguments)}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(n),!0).forEach(function(r){fr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rz(r.key),r)}}function bbe(e,t,n){return t&&CI(e.prototype,t),n&&CI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xbe(e,t,n){return t=Cy(t),wbe(e,nz()?Reflect.construct(t,n||[],Cy(e).constructor):t.apply(e,n))}function wbe(e,t){if(t&&(Qu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sbe(e)}function Sbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nz=function(){return!!e})()}function Cy(e){return Cy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cy(e)}function kbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&US(e,t)}function US(e,t){return US=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},US(e,t)}function fr(e,t,n){return t=rz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rz(e){var t=Obe(e,"string");return Qu(t)=="symbol"?t:t+""}function Obe(e,t){if(Qu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Cbe=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,o=t.x,s=t.width,a=t.travellerWidth;if(!n||!n.length)return{};var l=n.length,u=qf().domain(ky(0,l)).range([o,o+s-a]),c=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:c}},AI=function(t){return t.changedTouches&&!!t.changedTouches.length},Xu=function(e){function t(n){var r;return vbe(this,t),r=xbe(this,t,[n]),fr(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),fr(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),fr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s?.({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),fr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),fr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),fr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),fr(r,"handleSlideDragStart",function(i){var o=AI(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return kbe(t,e),bbe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,a=this.props,l=a.gap,u=a.data,c=u.length-1,f=Math.min(i,o),h=Math.max(i,o),d=t.getIndexInRange(s,f),p=t.getIndexInRange(s,h);return{startIndex:d-d%l,endIndex:p===c?c:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,a=i.dataKey,l=zt(o[r],a,r);return xe(s)?s(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,a=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,p=l.onChange,m=r.pageX-o;m>0?m=Math.min(m,u+c-f-a,u+c-f-s):m<0&&(m=Math.max(m,u-s,u-a));var y=this.getIndex({startX:s+m,endX:a+m});(y.startIndex!==h||y.endIndex!==d)&&p&&p(y),this.setState({startX:s+m,endX:a+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=AI(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,a=i.endX,l=i.startX,u=this.state[s],c=this.props,f=c.x,h=c.width,d=c.travellerWidth,p=c.onChange,m=c.gap,y=c.data,g={startX:this.state.startX,endX:this.state.endX},v=r.pageX-o;v>0?v=Math.min(v,f+h-d-u):v<0&&(v=Math.max(v,f-u)),g[s]=u+v;var x=this.getIndex(g),k=x.startIndex,w=x.endIndex,S=function(){var A=y.length-1;return s==="startX"&&(a>l?k%m===0:w%m===0)||a<l&&w===A||s==="endX"&&(a>l?w%m===0:k%m===0)||a>l&&w===A};this.setState(fr(fr({},s,u+v),"brushMoveStartX",r.pageX),function(){p&&S()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,u=s.endX,c=this.state[i],f=a.indexOf(c);if(f!==-1){var h=f+r;if(!(h===-1||h>=a.length)){var d=a[h];i==="startX"&&d>=u||i==="endX"&&d<=l||this.setState(fr({},i,d),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.fill,u=r.stroke;return L.createElement("rect",{stroke:u,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,u=r.children,c=r.padding,f=C.Children.only(u);return f?L.cloneElement(f,{x:i,y:o,width:s,height:a,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,h=l.traveller,d=l.ariaLabel,p=l.data,m=l.startIndex,y=l.endIndex,g=Math.max(r,this.props.x),v=Cx(Cx({},de(this.props,!1)),{},{x:g,y:u,width:c,height:f}),x=d||"Min value: ".concat((o=p[m])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[y])===null||s===void 0?void 0:s.name);return L.createElement(je,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),a.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,v))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,u=o.travellerWidth,c=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return L.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:c,y:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=r.height,l=r.travellerWidth,u=r.stroke,c=this.state,f=c.startX,h=c.endX,d=5,p={pointerEvents:"none",fill:u};return L.createElement(je,{className:"recharts-brush-texts"},L.createElement(Ka,Oy({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:s+a/2},p),this.getTextOfTick(i)),L.createElement(Ka,Oy({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,u=r.width,c=r.height,f=r.alwaysShowText,h=this.state,d=h.startX,p=h.endX,m=h.isTextActive,y=h.isSlideMoving,g=h.isTravellerMoving,v=h.isTravellerFocused;if(!i||!i.length||!ne(a)||!ne(l)||!ne(u)||!ne(c)||u<=0||c<=0)return null;var x=Se("recharts-brush",o),k=L.Children.count(s)===1,w=ybe("userSelect","none");return L.createElement(je,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(d,p),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(p,"endX"),(m||y||g||v||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,u=Math.floor(o+a/2)-1;return L.createElement(L.Fragment,null,L.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),L.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),L.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return L.isValidElement(r)?o=L.cloneElement(r,i):xe(r)?o=r(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,u=r.updateId,c=r.startIndex,f=r.endIndex;if(o!==i.prevData||u!==i.prevUpdateId)return Cx({prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:a,prevWidth:s},o&&o.length?Cbe({data:o,width:s,x:a,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:a,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}])}(C.PureComponent);fr(Xu,"displayName","Brush");fr(Xu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Abe=uA;function Pbe(e,t){var n;return Abe(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}var Ebe=Pbe,Tbe=GF,_be=Fs,Mbe=Ebe,Ibe=nr,jbe=d0;function Rbe(e,t,n){var r=Ibe(e)?Tbe:Mbe;return n&&jbe(e,t,n)&&(t=void 0),r(e,_be(t))}var Nbe=Rbe;const Dbe=De(Nbe);var Wi=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},PI=m3;function Lbe(e,t,n){t=="__proto__"&&PI?PI(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var $be=Lbe,Bbe=$be,Fbe=d3,zbe=Fs;function Wbe(e,t){var n={};return t=zbe(t),Fbe(e,function(r,i,o){Bbe(n,i,t(r,i,o))}),n}var Ube=Wbe;const Hbe=De(Ube);function Vbe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var qbe=Vbe,Kbe=uA;function Gbe(e,t){var n=!0;return Kbe(e,function(r,i,o){return n=!!t(r,i,o),n}),n}var Qbe=Gbe,Xbe=qbe,Ybe=Qbe,Zbe=Fs,Jbe=nr,exe=d0;function txe(e,t,n){var r=Jbe(e)?Xbe:Ybe;return n&&exe(e,t,n)&&(t=void 0),r(e,Zbe(t))}var nxe=txe;const rxe=De(nxe);var ixe=["x","y"];function hd(e){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(e)}function HS(){return HS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HS.apply(this,arguments)}function EI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EI(Object(n),!0).forEach(function(r){oxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oxe(e,t,n){return t=sxe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sxe(e){var t=axe(e,"string");return hd(t)=="symbol"?t:t+""}function axe(e,t){if(hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lxe(e,t){if(e==null)return{};var n=uxe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uxe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cxe(e,t){var n=e.x,r=e.y,i=lxe(e,ixe),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),u="".concat(t.height||i.height),c=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return pf(pf(pf(pf(pf({},t),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function TI(e){return L.createElement(Z4,HS({shapeType:"rectangle",propTransformer:cxe,activeClassName:"recharts-active-bar"},e))}var fxe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var o=ne(r)||EJ(r);return o?t(r,i):(o||Qa(),n)}},hxe=["value","background"],iz;function Yu(e){"@babel/helpers - typeof";return Yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yu(e)}function dxe(e,t){if(e==null)return{};var n=pxe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pxe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ay.apply(this,arguments)}function _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){os(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sz(r.key),r)}}function gxe(e,t,n){return t&&MI(e.prototype,t),n&&MI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yxe(e,t,n){return t=Py(t),vxe(e,oz()?Reflect.construct(t,n||[],Py(e).constructor):t.apply(e,n))}function vxe(e,t){if(t&&(Yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bxe(e)}function bxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oz=function(){return!!e})()}function Py(e){return Py=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Py(e)}function xxe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VS(e,t)}function VS(e,t){return VS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},VS(e,t)}function os(e,t,n){return t=sz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sz(e){var t=wxe(e,"string");return Yu(t)=="symbol"?t:t+""}function wxe(e,t){if(Yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cl=function(e){function t(){var n;mxe(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=yxe(this,t,[].concat(i)),os(n,"state",{isAnimationFinished:!1}),os(n,"id",Ec("recharts-bar-")),os(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),os(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return xxe(t,e),gxe(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,s=o.shape,a=o.dataKey,l=o.activeIndex,u=o.activeBar,c=de(this.props,!1);return r&&r.map(function(f,h){var d=h===l,p=d?u:s,m=Mt(Mt(Mt({},c),f),{},{isActive:d,option:p,index:h,dataKey:a,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return L.createElement(je,Ay({className:"recharts-bar-rectangle"},qa(i.props,f,h),{key:"rectangle-".concat(f?.x,"-").concat(f?.y,"-").concat(f?.value,"-").concat(h)}),L.createElement(TI,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,s=i.layout,a=i.isAnimationActive,l=i.animationBegin,u=i.animationDuration,c=i.animationEasing,f=i.animationId,h=this.state.prevData;return L.createElement(Ki,{begin:l,duration:u,isActive:a,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(d){var p=d.t,m=o.map(function(y,g){var v=h&&h[g];if(v){var x=gr(v.x,y.x),k=gr(v.y,y.y),w=gr(v.width,y.width),S=gr(v.height,y.height);return Mt(Mt({},y),{},{x:x(p),y:k(p),width:w(p),height:S(p)})}if(s==="horizontal"){var O=gr(0,y.height),A=O(p);return Mt(Mt({},y),{},{y:y.y+y.height-A,height:A})}var P=gr(0,y.width),M=P(p);return Mt(Mt({},y),{},{width:M})});return L.createElement(je,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,s=this.state.prevData;return o&&i&&i.length&&(!s||!Jd(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,s=i.dataKey,a=i.activeIndex,l=de(this.props.background,!1);return o.map(function(u,c){u.value;var f=u.background,h=dxe(u,hxe);if(!f)return null;var d=Mt(Mt(Mt(Mt(Mt({},h),{},{fill:"#eee"},f),l),qa(r.props,u,c)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:c,className:"recharts-bar-background-rectangle"});return L.createElement(TI,Ay({key:"background-bar-".concat(c),option:r.props.background,isActive:c===a},d))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.data,a=o.xAxis,l=o.yAxis,u=o.layout,c=o.children,f=kr(c,ep);if(!f)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,d=function(y,g){var v=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:v,errorVal:zt(y,g)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return L.createElement(je,p,f.map(function(m){return L.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:s,xAxis:a,yAxis:l,layout:u,offset:h,dataPointFormatter:d})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,s=r.className,a=r.xAxis,l=r.yAxis,u=r.left,c=r.top,f=r.width,h=r.height,d=r.isAnimationActive,p=r.background,m=r.id;if(i||!o||!o.length)return null;var y=this.state.isAnimationFinished,g=Se("recharts-bar",s),v=a&&a.allowDataOverflow,x=l&&l.allowDataOverflow,k=v||x,w=we(m)?this.id:m;return L.createElement(je,{className:g},v||x?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(w)},L.createElement("rect",{x:v?u:u-f/2,y:x?c:c-h/2,width:v?f:f*2,height:x?h:h*2}))):null,L.createElement(je,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(w,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,w),(!d||y)&&xo.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(C.PureComponent);iz=cl;os(cl,"displayName","Bar");os(cl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!sl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});os(cl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,o=e.xAxis,s=e.yAxis,a=e.xAxisTicks,l=e.yAxisTicks,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,d=Gpe(r,n);if(!d)return null;var p=t.layout,m=n.type.defaultProps,y=m!==void 0?Mt(Mt({},m),n.props):n.props,g=y.dataKey,v=y.children,x=y.minPointSize,k=p==="horizontal"?s:o,w=u?k.scale.domain():null,S=tme({numericAxis:k}),O=kr(v,Fu),A=f.map(function(P,M){var _,E,R,N,j,B;u?_=Qpe(u[c+M],w):(_=zt(P,g),Array.isArray(_)||(_=[S,_]));var F=fxe(x,iz.defaultProps.minPointSize)(_[1],M);if(p==="horizontal"){var $,z=[s.scale(_[0]),s.scale(_[1])],T=z[0],q=z[1];E=kM({axis:o,ticks:a,bandSize:i,offset:d.offset,entry:P,index:M}),R=($=q??T)!==null&&$!==void 0?$:void 0,N=d.size;var D=T-q;if(j=Number.isNaN(D)?0:D,B={x:E,y:s.y,width:N,height:s.height},Math.abs(F)>0&&Math.abs(j)<Math.abs(F)){var I=Mn(j||F)*(Math.abs(F)-Math.abs(j));R-=I,j+=I}}else{var Y=[o.scale(_[0]),o.scale(_[1])],G=Y[0],te=Y[1];if(E=G,R=kM({axis:s,ticks:l,bandSize:i,offset:d.offset,entry:P,index:M}),N=te-G,j=d.size,B={x:o.x,y:R,width:o.width,height:j},Math.abs(F)>0&&Math.abs(N)<Math.abs(F)){var fe=Mn(N||F)*(Math.abs(F)-Math.abs(N));N+=fe}}return Mt(Mt(Mt({},P),{},{x:E,y:R,width:N,height:j,value:u?_:_[1],payload:P,background:B},O&&O[M]&&O[M].props),{},{tooltipPayload:[_4(n,P)],tooltipPosition:{x:E+N/2,y:R+j/2}})});return Mt({data:A,layout:p},h)});function dd(e){"@babel/helpers - typeof";return dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dd(e)}function Sxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function II(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,az(r.key),r)}}function kxe(e,t,n){return t&&II(e.prototype,t),n&&II(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jI(Object(n),!0).forEach(function(r){I0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I0(e,t,n){return t=az(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function az(e){var t=Oxe(e,"string");return dd(t)=="symbol"?t:t+""}function Oxe(e,t){if(dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lz=function(t,n,r,i,o){var s=t.width,a=t.height,l=t.layout,u=t.children,c=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:a-r.bottom,bottomMirror:a-r.bottom},h=!!dr(u,cl);return c.reduce(function(d,p){var m=n[p],y=m.orientation,g=m.domain,v=m.padding,x=v===void 0?{}:v,k=m.mirror,w=m.reversed,S="".concat(y).concat(k?"Mirror":""),O,A,P,M,_;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var E=g[1]-g[0],R=1/0,N=m.categoricalDomain.sort(MJ);if(N.forEach(function(Y,G){G>0&&(R=Math.min((Y||0)-(N[G-1]||0),R))}),Number.isFinite(R)){var j=R/E,B=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(O=j*B/2),m.padding==="no-gap"){var F=In(t.barCategoryGap,j*B),$=j*B/2;O=$-F-($-F)/B*F}}}i==="xAxis"?A=[r.left+(x.left||0)+(O||0),r.left+r.width-(x.right||0)-(O||0)]:i==="yAxis"?A=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(O||0),r.top+r.height-(x.bottom||0)-(O||0)]:A=m.range,w&&(A=[A[1],A[0]]);var z=A4(m,o,h),T=z.scale,q=z.realScaleType;T.domain(g).range(A),P4(T);var D=E4(T,ii(ii({},m),{},{realScaleType:q}));i==="xAxis"?(_=y==="top"&&!k||y==="bottom"&&k,P=r.left,M=f[S]-_*m.height):i==="yAxis"&&(_=y==="left"&&!k||y==="right"&&k,P=f[S]-_*m.width,M=r.top);var I=ii(ii(ii({},m),D),{},{realScaleType:q,x:P,y:M,scale:T,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return I.bandSize=uy(I,D),!m.hide&&i==="xAxis"?f[S]+=(_?-1:1)*I.height:m.hide||(f[S]+=(_?-1:1)*I.width),ii(ii({},d),{},I0({},p,I))},{})},uz=function(t,n){var r=t.x,i=t.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},Cxe=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2;return uz({x:n,y:r},{x:i,y:o})},cz=function(){function e(t){Sxe(this,e),this.scale=t}return kxe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();I0(cz,"EPS",1e-4);var $A=function(t){var n=Object.keys(t).reduce(function(r,i){return ii(ii({},r),{},I0({},i,cz.create(t[i])))},{});return ii(ii({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return Hbe(i,function(l,u){return n[u].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return rxe(i,function(o,s){return n[s].isInRange(o)})}})};function Axe(e){return(e%180+180)%180}var Pxe=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Axe(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s<Math.PI-a?r/Math.sin(s):n/Math.cos(s);return Math.abs(l)},Exe=RZ(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),fz=C.createContext(void 0),hz=C.createContext(void 0),dz=C.createContext(void 0),Txe=C.createContext({}),pz=C.createContext(void 0),mz=C.createContext(0),gz=C.createContext(0),RI=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=t.clipPathId,a=t.children,l=t.width,u=t.height,c=Exe(o);return L.createElement(fz.Provider,{value:r},L.createElement(hz.Provider,{value:i},L.createElement(Txe.Provider,{value:o},L.createElement(dz.Provider,{value:c},L.createElement(pz.Provider,{value:s},L.createElement(mz.Provider,{value:u},L.createElement(gz.Provider,{value:l},a)))))))},_xe=function(){return C.useContext(pz)},yz=function(t){var n=C.useContext(fz);n==null&&Qa();var r=n[t];return r==null&&Qa(),r},vz=function(t){var n=C.useContext(hz);n==null&&Qa();var r=n[t];return r==null&&Qa(),r},Mxe=function(){var t=C.useContext(dz);return t},bz=function(){return C.useContext(gz)},xz=function(){return C.useContext(mz)};function Zu(e){"@babel/helpers - typeof";return Zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(e)}function Ixe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jxe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sz(r.key),r)}}function Rxe(e,t,n){return t&&jxe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nxe(e,t,n){return t=Ey(t),Dxe(e,wz()?Reflect.construct(t,n||[],Ey(e).constructor):t.apply(e,n))}function Dxe(e,t){if(t&&(Zu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lxe(e)}function Lxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wz=function(){return!!e})()}function Ey(e){return Ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ey(e)}function $xe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qS(e,t)}function qS(e,t){return qS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qS(e,t)}function NI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function DI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(r){BA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BA(e,t,n){return t=Sz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sz(e){var t=Bxe(e,"string");return Zu(t)=="symbol"?t:t+""}function Bxe(e,t){if(Zu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Fxe(e,t){return Hxe(e)||Uxe(e,t)||Wxe(e,t)||zxe()}function zxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
328
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wxe(e,t){if(e){if(typeof e=="string")return LI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LI(e,t)}}function LI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uxe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function Hxe(e){if(Array.isArray(e))return e}function KS(){return KS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KS.apply(this,arguments)}var Vxe=function(t,n){var r;return L.isValidElement(t)?r=L.cloneElement(t,n):xe(t)?r=t(n):r=L.createElement("line",KS({},n,{className:"recharts-reference-line-line"})),r},qxe=function(t,n,r,i,o,s,a,l,u){var c=o.x,f=o.y,h=o.width,d=o.height;if(r){var p=u.y,m=t.y.apply(p,{position:s});if(Wi(u,"discard")&&!t.y.isInRange(m))return null;var y=[{x:c+h,y:m},{x:c,y:m}];return l==="left"?y.reverse():y}if(n){var g=u.x,v=t.x.apply(g,{position:s});if(Wi(u,"discard")&&!t.x.isInRange(v))return null;var x=[{x:v,y:f+d},{x:v,y:f}];return a==="top"?x.reverse():x}if(i){var k=u.segment,w=k.map(function(S){return t.apply(S,{position:s})});return Wi(u,"discard")&&Dbe(w,function(S){return!t.isInRange(S)})?null:w}return null};function Kxe(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,o=e.yAxisId,s=e.shape,a=e.className,l=e.alwaysShow,u=_xe(),c=yz(i),f=vz(o),h=Mxe();if(!u||!h)return null;vo(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=$A({x:c.scale,y:f.scale}),p=Ht(t),m=Ht(n),y=r&&r.length===2,g=qxe(d,p,m,y,h,e.position,c.orientation,f.orientation,e);if(!g)return null;var v=Fxe(g,2),x=v[0],k=x.x,w=x.y,S=v[1],O=S.x,A=S.y,P=Wi(e,"hidden")?"url(#".concat(u,")"):void 0,M=DI(DI({clipPath:P},de(e,!0)),{},{x1:k,y1:w,x2:O,y2:A});return L.createElement(je,{className:Se("recharts-reference-line",a)},Vxe(s,M),Qt.renderCallByParent(e,Cxe({x1:k,y1:w,x2:O,y2:A})))}var FA=function(e){function t(){return Ixe(this,t),Nxe(this,t,arguments)}return $xe(t,e),Rxe(t,[{key:"render",value:function(){return L.createElement(Kxe,this.props)}}])}(L.Component);BA(FA,"displayName","ReferenceLine");BA(FA,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function GS(){return GS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GS.apply(this,arguments)}function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){j0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qxe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Oz(r.key),r)}}function Xxe(e,t,n){return t&&Qxe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yxe(e,t,n){return t=Ty(t),Zxe(e,kz()?Reflect.construct(t,n||[],Ty(e).constructor):t.apply(e,n))}function Zxe(e,t){if(t&&(Ju(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jxe(e)}function Jxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kz=function(){return!!e})()}function Ty(e){return Ty=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ty(e)}function e1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QS(e,t)}function QS(e,t){return QS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},QS(e,t)}function j0(e,t,n){return t=Oz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oz(e){var t=t1e(e,"string");return Ju(t)=="symbol"?t:t+""}function t1e(e,t){if(Ju(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ju(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var n1e=function(t){var n=t.x,r=t.y,i=t.xAxis,o=t.yAxis,s=$A({x:i.scale,y:o.scale}),a=s.apply({x:n,y:r},{bandAware:!0});return Wi(t,"discard")&&!s.isInRange(a)?null:a},R0=function(e){function t(){return Gxe(this,t),Yxe(this,t,arguments)}return e1e(t,e),Xxe(t,[{key:"render",value:function(){var r=this.props,i=r.x,o=r.y,s=r.r,a=r.alwaysShow,l=r.clipPathId,u=Ht(i),c=Ht(o);if(vo(a===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!c)return null;var f=n1e(this.props);if(!f)return null;var h=f.x,d=f.y,p=this.props,m=p.shape,y=p.className,g=Wi(this.props,"hidden")?"url(#".concat(l,")"):void 0,v=BI(BI({clipPath:g},de(this.props,!0)),{},{cx:h,cy:d});return L.createElement(je,{className:Se("recharts-reference-dot",y)},t.renderDot(m,v),Qt.renderCallByParent(this.props,{x:h-s,y:d-s,width:2*s,height:2*s}))}}])}(L.Component);j0(R0,"displayName","ReferenceDot");j0(R0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});j0(R0,"renderDot",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):xe(e)?n=e(t):n=L.createElement(C0,GS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function XS(){return XS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XS.apply(this,arguments)}function ec(e){"@babel/helpers - typeof";return ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(e)}function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){N0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i1e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Az(r.key),r)}}function o1e(e,t,n){return t&&i1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s1e(e,t,n){return t=_y(t),a1e(e,Cz()?Reflect.construct(t,n||[],_y(e).constructor):t.apply(e,n))}function a1e(e,t){if(t&&(ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l1e(e)}function l1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cz=function(){return!!e})()}function _y(e){return _y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_y(e)}function u1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YS(e,t)}function YS(e,t){return YS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},YS(e,t)}function N0(e,t,n){return t=Az(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Az(e){var t=c1e(e,"string");return ec(t)=="symbol"?t:t+""}function c1e(e,t){if(ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var f1e=function(t,n,r,i,o){var s=o.x1,a=o.x2,l=o.y1,u=o.y2,c=o.xAxis,f=o.yAxis;if(!c||!f)return null;var h=$A({x:c.scale,y:f.scale}),d={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(l,{position:"start"}):h.y.rangeMin},p={x:n?h.x.apply(a,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Wi(o,"discard")&&(!h.isInRange(d)||!h.isInRange(p))?null:uz(d,p)},D0=function(e){function t(){return r1e(this,t),s1e(this,t,arguments)}return u1e(t,e),o1e(t,[{key:"render",value:function(){var r=this.props,i=r.x1,o=r.x2,s=r.y1,a=r.y2,l=r.className,u=r.alwaysShow,c=r.clipPathId;vo(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ht(i),h=Ht(o),d=Ht(s),p=Ht(a),m=this.props.shape;if(!f&&!h&&!d&&!p&&!m)return null;var y=f1e(f,h,d,p,this.props);if(!y&&!m)return null;var g=Wi(this.props,"hidden")?"url(#".concat(c,")"):void 0;return L.createElement(je,{className:Se("recharts-reference-area",l)},t.renderRect(m,zI(zI({clipPath:g},de(this.props,!0)),y)),Qt.renderCallByParent(this.props,y))}}])}(L.Component);N0(D0,"displayName","ReferenceArea");N0(D0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});N0(D0,"renderRect",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):xe(e)?n=e(t):n=L.createElement(LA,XS({},t,{className:"recharts-reference-area-rect"})),n});function Pz(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function h1e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Pxe(r,n)}function d1e(e,t,n){var r=n==="width",i=e.x,o=e.y,s=e.width,a=e.height;return t===1?{start:r?i:o,end:r?i+s:o+a}:{start:r?i+s:o+a,end:r?i:o}}function My(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function p1e(e,t){return Pz(e,t+1)}function m1e(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,a=t.end,l=0,u=1,c=s,f=function(){var p=r?.[l];if(p===void 0)return{v:Pz(r,u)};var m=l,y,g=function(){return y===void 0&&(y=n(p,m)),y},v=p.coordinate,x=l===0||My(e,v,g,c,a);x||(l=0,c=s,u+=1),x&&(c=v+e*(g()/2+i),l+=u)},h;u<=o.length;)if(h=f(),h)return h.v;return[]}function pd(e){"@babel/helpers - typeof";return pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pd(e)}function WI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WI(Object(n),!0).forEach(function(r){g1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g1e(e,t,n){return t=y1e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y1e(e){var t=v1e(e,"string");return pd(t)=="symbol"?t:t+""}function v1e(e,t){if(pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b1e(e,t,n,r,i){for(var o=(r||[]).slice(),s=o.length,a=t.start,l=t.end,u=function(h){var d=o[h],p,m=function(){return p===void 0&&(p=n(d,h)),p};if(h===s-1){var y=e*(d.coordinate+e*m()/2-l);o[h]=d=mn(mn({},d),{},{tickCoord:y>0?d.coordinate-y*e:d.coordinate})}else o[h]=d=mn(mn({},d),{},{tickCoord:d.coordinate});var g=My(e,d.tickCoord,m,a,l);g&&(l=d.tickCoord-e*(m()/2+i),o[h]=mn(mn({},d),{},{isShow:!0}))},c=s-1;c>=0;c--)u(c);return o}function x1e(e,t,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=t.start,u=t.end;if(o){var c=r[a-1],f=n(c,a-1),h=e*(c.coordinate+e*f/2-u);s[a-1]=c=mn(mn({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=My(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),s[a-1]=mn(mn({},c),{},{isShow:!0}))}for(var p=o?a-1:a,m=function(v){var x=s[v],k,w=function(){return k===void 0&&(k=n(x,v)),k};if(v===0){var S=e*(x.coordinate-e*w()/2-l);s[v]=x=mn(mn({},x),{},{tickCoord:S<0?x.coordinate-S*e:x.coordinate})}else s[v]=x=mn(mn({},x),{},{tickCoord:x.coordinate});var O=My(e,x.tickCoord,w,l,u);O&&(l=x.tickCoord+e*(w()/2+i),s[v]=mn(mn({},x),{},{isShow:!0}))},y=0;y<p;y++)m(y);return s}function w1e(e,t,n){var r=e.tick,i=e.ticks,o=e.viewBox,s=e.minTickGap,a=e.orientation,l=e.interval,u=e.tickFormatter,c=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(ne(l)||sl.isSsr)return p1e(i,typeof l=="number"&&ne(l)?l:0);var h=[],d=a==="top"||a==="bottom"?"width":"height",p=c&&d==="width"?Vf(c,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,k){var w=xe(u)?u(x.value,k):x.value;return d==="width"?h1e(Vf(w,{fontSize:t,letterSpacing:n}),p,f):Vf(w,{fontSize:t,letterSpacing:n})[d]},y=i.length>=2?Mn(i[1].coordinate-i[0].coordinate):1,g=d1e(o,y,d);return l==="equidistantPreserveStart"?m1e(y,g,m,i,s):(l==="preserveStart"||l==="preserveStartEnd"?h=x1e(y,g,m,i,s,l==="preserveStartEnd"):h=b1e(y,g,m,i,s),h.filter(function(v){return v.isShow}))}var S1e=["viewBox"],k1e=["viewBox"],O1e=["ticks"];function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function Xl(){return Xl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xl.apply(this,arguments)}function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){zA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ax(e,t){if(e==null)return{};var n=C1e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function C1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function A1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tz(r.key),r)}}function P1e(e,t,n){return t&&HI(e.prototype,t),n&&HI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function E1e(e,t,n){return t=Iy(t),T1e(e,Ez()?Reflect.construct(t,n||[],Iy(e).constructor):t.apply(e,n))}function T1e(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _1e(e)}function _1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ez(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ez=function(){return!!e})()}function Iy(e){return Iy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Iy(e)}function M1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZS(e,t)}function ZS(e,t){return ZS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ZS(e,t)}function zA(e,t,n){return t=Tz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tz(e){var t=I1e(e,"string");return tc(t)=="symbol"?t:t+""}function I1e(e,t){if(tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L0=function(e){function t(n){var r;return A1e(this,t),r=E1e(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return M1e(t,e),P1e(t,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,s=Ax(r,S1e),a=this.props,l=a.viewBox,u=Ax(a,k1e);return!hu(o,l)||!hu(s,u)||!hu(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,s=i.y,a=i.width,l=i.height,u=i.orientation,c=i.tickSize,f=i.mirror,h=i.tickMargin,d,p,m,y,g,v,x=f?-1:1,k=r.tickSize||c,w=ne(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":d=p=r.coordinate,y=s+ +!f*l,m=y-x*k,v=m-x*h,g=w;break;case"left":m=y=r.coordinate,p=o+ +!f*a,d=p-x*k,g=d-x*h,v=w;break;case"right":m=y=r.coordinate,p=o+ +f*a,d=p+x*k,g=d+x*h,v=w;break;default:d=p=r.coordinate,y=s+ +f*l,m=y+x*k,v=m+x*h,g=w;break}return{line:{x1:d,y1:m,x2:p,y2:y},tick:{x:g,y:v}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s;switch(i){case"left":s=o?"start":"end";break;case"right":s=o?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=o?"start":"end";break;default:s=o?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.orientation,u=r.mirror,c=r.axisLine,f=Dt(Dt(Dt({},de(this.props,!1)),de(c,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var h=+(l==="top"&&!u||l==="bottom"&&u);f=Dt(Dt({},f),{},{x1:i,y1:o+h*a,x2:i+s,y2:o+h*a})}else{var d=+(l==="left"&&!u||l==="right"&&u);f=Dt(Dt({},f),{},{x1:i+d*s,y1:o,x2:i+d*s,y2:o+a})}return L.createElement("line",Xl({},f,{className:Se("recharts-cartesian-axis-line",Sr(c,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var s=this,a=this.props,l=a.tickLine,u=a.stroke,c=a.tick,f=a.tickFormatter,h=a.unit,d=w1e(Dt(Dt({},this.props),{},{ticks:r}),i,o),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),y=de(this.props,!1),g=de(c,!1),v=Dt(Dt({},y),{},{fill:"none"},de(l,!1)),x=d.map(function(k,w){var S=s.getTickLineCoord(k),O=S.line,A=S.tick,P=Dt(Dt(Dt(Dt({textAnchor:p,verticalAnchor:m},y),{},{stroke:"none",fill:u},g),A),{},{index:w,payload:k,visibleTicksCount:d.length,tickFormatter:f});return L.createElement(je,Xl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},qa(s.props,k,w)),l&&L.createElement("line",Xl({},v,O,{className:Se("recharts-cartesian-axis-tick-line",Sr(l,"className"))})),c&&t.renderTickItem(c,P,"".concat(xe(f)?f(k.value,w):k.value).concat(h||"")))});return L.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,s=i.width,a=i.height,l=i.ticksGenerator,u=i.className,c=i.hide;if(c)return null;var f=this.props,h=f.ticks,d=Ax(f,O1e),p=h;return xe(l)&&(p=h&&h.length>0?l(this.props):l(d)),s<=0||a<=0||!p||!p.length?null:L.createElement(je,{className:Se("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Qt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,a=Se(i.className,"recharts-cartesian-axis-tick-value");return L.isValidElement(r)?s=L.cloneElement(r,Dt(Dt({},i),{},{className:a})):xe(r)?s=r(Dt(Dt({},i),{},{className:a})):s=L.createElement(Ka,Xl({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])}(C.Component);zA(L0,"displayName","CartesianAxis");zA(L0,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var j1e=["type","layout","connectNulls","ref"],R1e=["key"];function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function VI(e,t){if(e==null)return{};var n=N1e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function N1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Yf(){return Yf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yf.apply(this,arguments)}function qI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){oi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kl(e){return B1e(e)||$1e(e)||L1e(e)||D1e()}function D1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
329
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L1e(e,t){if(e){if(typeof e=="string")return JS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JS(e,t)}}function $1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function B1e(e){if(Array.isArray(e))return JS(e)}function JS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mz(r.key),r)}}function z1e(e,t,n){return t&&KI(e.prototype,t),n&&KI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function W1e(e,t,n){return t=jy(t),U1e(e,_z()?Reflect.construct(t,n||[],jy(e).constructor):t.apply(e,n))}function U1e(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H1e(e)}function H1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_z=function(){return!!e})()}function jy(e){return jy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jy(e)}function V1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ek(e,t)}function ek(e,t){return ek=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ek(e,t)}function oi(e,t,n){return t=Mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mz(e){var t=q1e(e,"string");return nc(t)=="symbol"?t:t+""}function q1e(e,t){if(nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tp=function(e){function t(){var n;F1e(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=W1e(this,t,[].concat(i)),oi(n,"state",{isAnimationFinished:!0,totalLength:0}),oi(n,"generateSimpleStrokeDasharray",function(s,a){return"".concat(a,"px ").concat(s-a,"px")}),oi(n,"getStrokeDasharray",function(s,a,l){var u=l.reduce(function(g,v){return g+v});if(!u)return n.generateSimpleStrokeDasharray(a,s);for(var c=Math.floor(s/u),f=s%u,h=a-s,d=[],p=0,m=0;p<l.length;m+=l[p],++p)if(m+l[p]>f){d=[].concat(kl(l.slice(0,p)),[f-m]);break}var y=d.length%2===0?[0,h]:[h];return[].concat(kl(t.repeat(l,c)),kl(d),y).map(function(g){return"".concat(g,"px")}).join(", ")}),oi(n,"id",Ec("recharts-line-")),oi(n,"pathRef",function(s){n.mainCurve=s}),oi(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),oi(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return V1e(t,e),z1e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,u=o.layout,c=o.children,f=kr(c,ep);if(!f)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:zt(m.payload,y)}},d={clipPath:r?"url(#clipPath-".concat(i,")"):null};return L.createElement(je,d,f.map(function(p){return L.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,u=a.points,c=a.dataKey,f=de(this.props,!1),h=de(l,!0),d=u.map(function(m,y){var g=ur(ur(ur({key:"dot-".concat(y),r:3},f),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:c,payload:m.payload,points:u});return t.renderDotItem(l,g)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return L.createElement(je,Yf({className:"recharts-line-dots",key:"dots"},p),d)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,u=a.layout,c=a.connectNulls;a.ref;var f=VI(a,j1e),h=ur(ur(ur({},de(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:u,connectNulls:c});return L.createElement(hy,Yf({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,u=s.isAnimationActive,c=s.animationBegin,f=s.animationDuration,h=s.animationEasing,d=s.animationId,p=s.animateNewValues,m=s.width,y=s.height,g=this.state,v=g.prevPoints,x=g.totalLength;return L.createElement(Ki,{begin:c,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(k){var w=k.t;if(v){var S=v.length/a.length,O=a.map(function(E,R){var N=Math.floor(R*S);if(v[N]){var j=v[N],B=gr(j.x,E.x),F=gr(j.y,E.y);return ur(ur({},E),{},{x:B(w),y:F(w)})}if(p){var $=gr(m*2,E.x),z=gr(y/2,E.y);return ur(ur({},E),{},{x:$(w),y:z(w)})}return ur(ur({},E),{},{x:E.x,y:E.y})});return o.renderCurveStatically(O,r,i)}var A=gr(0,x),P=A(w),M;if(l){var _="".concat(l).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});M=o.getStrokeDasharray(P,x,_)}else M=o.generateSimpleStrokeDasharray(x,P);return o.renderCurveStatically(a,r,i,{strokeDasharray:M})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return a&&s&&s.length&&(!u&&c>0||!Jd(u,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,h=i.left,d=i.width,p=i.height,m=i.isAnimationActive,y=i.id;if(o||!a||!a.length)return null;var g=this.state.isAnimationFinished,v=a.length===1,x=Se("recharts-line",l),k=u&&u.allowDataOverflow,w=c&&c.allowDataOverflow,S=k||w,O=we(y)?this.id:y,A=(r=de(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},P=A.r,M=P===void 0?3:P,_=A.strokeWidth,E=_===void 0?2:_,R=FJ(s)?s:{},N=R.clipDot,j=N===void 0?!0:N,B=M*2+E;return L.createElement(je,{className:x},k||w?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(O)},L.createElement("rect",{x:k?h:h-d/2,y:w?f:f-p/2,width:k?d:d*2,height:w?p:p*2})),!j&&L.createElement("clipPath",{id:"clipPath-dots-".concat(O)},L.createElement("rect",{x:h-B/2,y:f-B/2,width:d+B,height:p+B}))):null,!v&&this.renderCurve(S,O),this.renderErrorBar(S,O),(v||s)&&this.renderDots(S,j,O),(!m||g)&&xo.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(kl(r),[0]):r,s=[],a=0;a<i;++a)s=[].concat(kl(s),kl(o));return s}},{key:"renderDotItem",value:function(r,i){var o;if(L.isValidElement(r))o=L.cloneElement(r,i);else if(xe(r))o=r(i);else{var s=i.key,a=VI(i,R1e),l=Se("recharts-line-dot",typeof r!="boolean"?r.className:"");o=L.createElement(C0,Yf({key:s},a,{className:l}))}return o}}])}(C.PureComponent);oi(tp,"displayName","Line");oi(tp,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!sl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});oi(tp,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.dataKey,a=e.bandSize,l=e.displayedData,u=e.offset,c=t.layout,f=l.map(function(h,d){var p=zt(h,s);return c==="horizontal"?{x:SM({axis:n,ticks:i,bandSize:a,entry:h,index:d}),y:we(p)?null:r.scale(p),value:p,payload:h}:{x:we(p)?null:n.scale(p),y:SM({axis:r,ticks:o,bandSize:a,entry:h,index:d}),value:p,payload:h}});return ur({points:f,layout:c},u)});function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}function K1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G1e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rz(r.key),r)}}function Q1e(e,t,n){return t&&G1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function X1e(e,t,n){return t=Ry(t),Y1e(e,Iz()?Reflect.construct(t,n||[],Ry(e).constructor):t.apply(e,n))}function Y1e(e,t){if(t&&(rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z1e(e)}function Z1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Iz=function(){return!!e})()}function Ry(e){return Ry=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ry(e)}function J1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tk(e,t)}function tk(e,t){return tk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tk(e,t)}function jz(e,t,n){return t=Rz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rz(e){var t=ewe(e,"string");return rc(t)=="symbol"?t:t+""}function ewe(e,t){if(rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function nk(){return nk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nk.apply(this,arguments)}function twe(e){var t=e.xAxisId,n=bz(),r=xz(),i=yz(t);return i==null?null:C.createElement(L0,nk({},i,{className:Se("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return xa(s,!0)}}))}var Nc=function(e){function t(){return K1e(this,t),X1e(this,t,arguments)}return J1e(t,e),Q1e(t,[{key:"render",value:function(){return C.createElement(twe,this.props)}}])}(C.Component);jz(Nc,"displayName","XAxis");jz(Nc,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function ic(e){"@babel/helpers - typeof";return ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}function nwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lz(r.key),r)}}function iwe(e,t,n){return t&&rwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function owe(e,t,n){return t=Ny(t),swe(e,Nz()?Reflect.construct(t,n||[],Ny(e).constructor):t.apply(e,n))}function swe(e,t){if(t&&(ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return awe(e)}function awe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nz=function(){return!!e})()}function Ny(e){return Ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ny(e)}function lwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rk(e,t)}function rk(e,t){return rk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rk(e,t)}function Dz(e,t,n){return t=Lz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lz(e){var t=uwe(e,"string");return ic(t)=="symbol"?t:t+""}function uwe(e,t){if(ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ik(){return ik=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ik.apply(this,arguments)}var cwe=function(t){var n=t.yAxisId,r=bz(),i=xz(),o=vz(n);return o==null?null:C.createElement(L0,ik({},o,{className:Se("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(a){return xa(a,!0)}}))},Dc=function(e){function t(){return nwe(this,t),owe(this,t,arguments)}return lwe(t,e),iwe(t,[{key:"render",value:function(){return C.createElement(cwe,this.props)}}])}(C.Component);Dz(Dc,"displayName","YAxis");Dz(Dc,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function GI(e){return pwe(e)||dwe(e)||hwe(e)||fwe()}function fwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
330
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hwe(e,t){if(e){if(typeof e=="string")return ok(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ok(e,t)}}function dwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pwe(e){if(Array.isArray(e))return ok(e)}function ok(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sk=function(t,n,r,i,o){var s=kr(t,FA),a=kr(t,R0),l=[].concat(GI(s),GI(a)),u=kr(t,D0),c="".concat(i,"Id"),f=i[0],h=n;if(l.length&&(h=l.reduce(function(m,y){if(y.props[c]===r&&Wi(y.props,"extendDomain")&&ne(y.props[f])){var g=y.props[f];return[Math.min(m[0],g),Math.max(m[1],g)]}return m},h)),u.length){var d="".concat(f,"1"),p="".concat(f,"2");h=u.reduce(function(m,y){if(y.props[c]===r&&Wi(y.props,"extendDomain")&&ne(y.props[d])&&ne(y.props[p])){var g=y.props[d],v=y.props[p];return[Math.min(m[0],g,v),Math.max(m[1],g,v)]}return m},h)}return o&&o.length&&(h=o.reduce(function(m,y){return ne(y)?[Math.min(m[0],y),Math.max(m[1],y)]:m},h)),h},$z={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,f,h){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new i(c,f||l,h),p=n?n+u:u;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],d]:l._events[p].push(d):(l._events[p]=d,l._eventsCount++),l}function s(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)t.call(c,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=n?n+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,d=f.length,p=new Array(d);h<d;h++)p[h]=f[h].fn;return p},a.prototype.listenerCount=function(u){var c=n?n+u:u,f=this._events[c];return f?f.fn?1:f.length:0},a.prototype.emit=function(u,c,f,h,d,p){var m=n?n+u:u;if(!this._events[m])return!1;var y=this._events[m],g=arguments.length,v,x;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),g){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,c),!0;case 3:return y.fn.call(y.context,c,f),!0;case 4:return y.fn.call(y.context,c,f,h),!0;case 5:return y.fn.call(y.context,c,f,h,d),!0;case 6:return y.fn.call(y.context,c,f,h,d,p),!0}for(x=1,v=new Array(g-1);x<g;x++)v[x-1]=arguments[x];y.fn.apply(y.context,v)}else{var k=y.length,w;for(x=0;x<k;x++)switch(y[x].once&&this.removeListener(u,y[x].fn,void 0,!0),g){case 1:y[x].fn.call(y[x].context);break;case 2:y[x].fn.call(y[x].context,c);break;case 3:y[x].fn.call(y[x].context,c,f);break;case 4:y[x].fn.call(y[x].context,c,f,h);break;default:if(!v)for(w=1,v=new Array(g-1);w<g;w++)v[w-1]=arguments[w];y[x].fn.apply(y[x].context,v)}}return!0},a.prototype.on=function(u,c,f){return o(this,u,c,f,!1)},a.prototype.once=function(u,c,f){return o(this,u,c,f,!0)},a.prototype.removeListener=function(u,c,f,h){var d=n?n+u:u;if(!this._events[d])return this;if(!c)return s(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!h||p.once)&&(!f||p.context===f)&&s(this,d);else{for(var m=0,y=[],g=p.length;m<g;m++)(p[m].fn!==c||h&&!p[m].once||f&&p[m].context!==f)&&y.push(p[m]);y.length?this._events[d]=y.length===1?y[0]:y:s(this,d)}return this},a.prototype.removeAllListeners=function(u){var c;return u?(c=n?n+u:u,this._events[c]&&s(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})($z);var mwe=$z.exports;const gwe=De(mwe);var Px=new gwe,Ex="recharts.syncMouseEvents";function md(e){"@babel/helpers - typeof";return md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},md(e)}function ywe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Bz(r.key),r)}}function bwe(e,t,n){return t&&vwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tx(e,t,n){return t=Bz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bz(e){var t=xwe(e,"string");return md(t)=="symbol"?t:t+""}function xwe(e,t){if(md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wwe=function(){function e(){ywe(this,e),Tx(this,"activeIndex",0),Tx(this,"coordinateList",[]),Tx(this,"layout","horizontal")}return bwe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,s=n.container,a=s===void 0?null:s,l=n.layout,u=l===void 0?null:l,c=n.offset,f=c===void 0?null:c,h=n.mouseHandlerCallback,d=h===void 0?null:h;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=a??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=d??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,s=i.y,a=i.height,l=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,c=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+l+u,h=s+this.offset.top+a/2+c;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function Swe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&ne(r)&&ne(i))return!0}return!1}function kwe(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function Fz(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,s=ot(t,n,r,i),a=ot(t,n,r,o);return{points:[s,a],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function Owe(e,t,n){var r,i,o,s;if(e==="horizontal")r=t.x,o=r,i=n.top,s=n.top+n.height;else if(e==="vertical")i=t.y,s=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var a=t.cx,l=t.cy,u=t.innerRadius,c=t.outerRadius,f=t.angle,h=ot(a,l,u,f),d=ot(a,l,c,f);r=h.x,i=h.y,o=d.x,s=d.y}else return Fz(t);return[{x:r,y:i},{x:o,y:s}]}function gd(e){"@babel/helpers - typeof";return gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gd(e)}function QI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QI(Object(n),!0).forEach(function(r){Cwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cwe(e,t,n){return t=Awe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Awe(e){var t=Pwe(e,"string");return gd(t)=="symbol"?t:t+""}function Pwe(e,t){if(gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ewe(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,s=e.activeCoordinate,a=e.activePayload,l=e.offset,u=e.activeTooltipIndex,c=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,d=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!d||!o||!s||h!=="ScatterChart"&&i!=="axis")return null;var p,m=hy;if(h==="ScatterChart")p=s,m=kve;else if(h==="BarChart")p=kwe(f,s,l,c),m=LA;else if(f==="radial"){var y=Fz(s),g=y.cx,v=y.cy,x=y.radius,k=y.startAngle,w=y.endAngle;p={cx:g,cy:v,startAngle:k,endAngle:w,innerRadius:x,outerRadius:x},m=D4}else p={points:Owe(f,s,l)},m=hy;var S=Gp(Gp(Gp(Gp({stroke:"#ccc",pointerEvents:"none"},l),p),de(d,!1)),{},{payload:a,payloadIndex:u,className:Se("recharts-tooltip-cursor",d.className)});return C.isValidElement(d)?C.cloneElement(d,S):C.createElement(m,S)}var Twe=["item"],_we=["children","className","width","height","style","compact","title","desc"];function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}function Yl(){return Yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yl.apply(this,arguments)}function XI(e,t){return jwe(e)||Iwe(e,t)||Wz(e,t)||Mwe()}function Mwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
331
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iwe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function jwe(e){if(Array.isArray(e))return e}function YI(e,t){if(e==null)return{};var n=Rwe(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rwe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Nwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Uz(r.key),r)}}function Lwe(e,t,n){return t&&Dwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $we(e,t,n){return t=Dy(t),Bwe(e,zz()?Reflect.construct(t,n||[],Dy(e).constructor):t.apply(e,n))}function Bwe(e,t){if(t&&(oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fwe(e)}function Fwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zz=function(){return!!e})()}function Dy(e){return Dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dy(e)}function zwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ak(e,t)}function ak(e,t){return ak=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ak(e,t)}function sc(e){return Hwe(e)||Uwe(e)||Wz(e)||Wwe()}function Wwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
332
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wz(e,t){if(e){if(typeof e=="string")return lk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lk(e,t)}}function Uwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hwe(e){if(Array.isArray(e))return lk(e)}function lk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ZI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZI(Object(n),!0).forEach(function(r){pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pe(e,t,n){return t=Uz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uz(e){var t=Vwe(e,"string");return oc(t)=="symbol"?t:t+""}function Vwe(e,t){if(oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qwe={xAxis:["bottom","top"],yAxis:["left","right"]},Kwe={width:"100%",height:"100%"},Hz={x:0,y:0};function Qp(e){return e}var Gwe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Qwe=function(t,n,r,i){var o=n.find(function(c){return c&&c.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,a=i.radius;return H(H(H({},i),ot(i.cx,i.cy,a,s)),{},{angle:s,radius:a})}var l=o.coordinate,u=i.angle;return H(H(H({},i),ot(i.cx,i.cy,l,u)),{},{angle:u,radius:l})}return Hz},$0=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(a,l){var u=l.props.data;return u&&u.length?[].concat(sc(a),sc(u)):a},[]);return s.length>0?s:t&&t.length&&ne(i)&&ne(o)?t.slice(i,o+1):[]};function Vz(e){return e==="number"?[0,"auto"]:void 0}var uk=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,a=$0(n,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var d=f===void 0?a:f;h=Rg(d,s.dataKey,i)}else h=f&&f[r]||a[r];return h?[].concat(sc(l),[_4(u,h)]):l},[])},JI=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=Gwe(o,r),a=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=Wpe(s,a,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=uk(t,n,c,f),d=Qwe(r,a,c,o);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},Xwe=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,d=C4(c,o);return r.reduce(function(p,m){var y,g=m.type.defaultProps!==void 0?H(H({},m.type.defaultProps),m.props):m.props,v=g.type,x=g.dataKey,k=g.allowDataOverflow,w=g.allowDuplicatedCategory,S=g.scale,O=g.ticks,A=g.includeHidden,P=g[s];if(p[P])return p;var M=$0(t.data,{graphicalItems:i.filter(function(D){var I,Y=s in D.props?D.props[s]:(I=D.type.defaultProps)===null||I===void 0?void 0:I[s];return Y===P}),dataStartIndex:l,dataEndIndex:u}),_=M.length,E,R,N;Swe(g.domain,k,v)&&(E=SS(g.domain,null,k),d&&(v==="number"||S!=="auto")&&(N=Kf(M,x,"category")));var j=Vz(v);if(!E||E.length===0){var B,F=(B=g.domain)!==null&&B!==void 0?B:j;if(x){if(E=Kf(M,x,v),v==="category"&&d){var $=_J(E);w&&$?(R=E,E=ky(0,_)):w||(E=AM(F,E,m).reduce(function(D,I){return D.indexOf(I)>=0?D:[].concat(sc(D),[I])},[]))}else if(v==="category")w?E=E.filter(function(D){return D!==""&&!we(D)}):E=AM(F,E,m).reduce(function(D,I){return D.indexOf(I)>=0||I===""||we(I)?D:[].concat(sc(D),[I])},[]);else if(v==="number"){var z=Kpe(M,i.filter(function(D){var I,Y,G=s in D.props?D.props[s]:(I=D.type.defaultProps)===null||I===void 0?void 0:I[s],te="hide"in D.props?D.props.hide:(Y=D.type.defaultProps)===null||Y===void 0?void 0:Y.hide;return G===P&&(A||!te)}),x,o,c);z&&(E=z)}d&&(v==="number"||S!=="auto")&&(N=Kf(M,x,"category"))}else d?E=ky(0,_):a&&a[P]&&a[P].hasStack&&v==="number"?E=h==="expand"?[0,1]:T4(a[P].stackGroups,l,u):E=O4(M,i.filter(function(D){var I=s in D.props?D.props[s]:D.type.defaultProps[s],Y="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return I===P&&(A||!Y)}),v,c,!0);if(v==="number")E=sk(f,E,P,o,O),F&&(E=SS(F,E,k));else if(v==="category"&&F){var T=F,q=E.every(function(D){return T.indexOf(D)>=0});q&&(E=T)}}return H(H({},p),{},pe({},P,H(H({},g),{},{axisType:o,domain:E,categoricalDomain:N,duplicateDomain:R,originalDomain:(y=g.domain)!==null&&y!==void 0?y:j,isCategorical:d,layout:c})))},{})},Ywe=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.layout,f=t.children,h=$0(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:u}),d=h.length,p=C4(c,o),m=-1;return r.reduce(function(y,g){var v=g.type.defaultProps!==void 0?H(H({},g.type.defaultProps),g.props):g.props,x=v[s],k=Vz("number");if(!y[x]){m++;var w;return p?w=ky(0,d):a&&a[x]&&a[x].hasStack?(w=T4(a[x].stackGroups,l,u),w=sk(f,w,x,o)):(w=SS(k,O4(h,r.filter(function(S){var O,A,P=s in S.props?S.props[s]:(O=S.type.defaultProps)===null||O===void 0?void 0:O[s],M="hide"in S.props?S.props.hide:(A=S.type.defaultProps)===null||A===void 0?void 0:A.hide;return P===x&&!M}),"number",c),i.defaultProps.allowDataOverflow),w=sk(f,w,x,o)),H(H({},y),{},pe({},x,H(H({axisType:o},i.defaultProps),{},{hide:!0,orientation:Sr(qwe,"".concat(o,".").concat(m%2),null),domain:w,originalDomain:k,isCategorical:p,layout:c})))}return y},{})},Zwe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=kr(c,o),d={};return h&&h.length?d=Xwe(t,{axes:h,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:u}):s&&s.length&&(d=Ywe(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:u})),d},Jwe=function(t){var n=Tl(t),r=xa(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:cA(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:uy(n,r)}},ej=function(t){var n=t.children,r=t.defaultShowTooltip,i=dr(n,Xu),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},eSe=function(t){return!t||!t.length?!1:t.some(function(n){var r=yo(n&&n.type);return r&&r.indexOf("Bar")>=0})},tj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},tSe=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,u=r.width,c=r.height,f=r.children,h=r.margin||{},d=dr(f,Xu),p=dr(f,du),m=Object.keys(l).reduce(function(w,S){var O=l[S],A=O.orientation;return!O.mirror&&!O.hide?H(H({},w),{},pe({},A,w[A]+O.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(s).reduce(function(w,S){var O=s[S],A=O.orientation;return!O.mirror&&!O.hide?H(H({},w),{},pe({},A,Sr(w,"".concat(A))+O.height)):w},{top:h.top||0,bottom:h.bottom||0}),g=H(H({},y),m),v=g.bottom;d&&(g.bottom+=d.props.height||Xu.defaultProps.height),p&&n&&(g=Vpe(g,i,r,n));var x=u-g.left-g.right,k=c-g.top-g.bottom;return H(H({brushBottom:v},g),{},{width:Math.max(x,0),height:Math.max(k,0)})},nSe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},WA=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(g,v){var x=v.graphicalItems,k=v.stackGroups,w=v.offset,S=v.updateId,O=v.dataStartIndex,A=v.dataEndIndex,P=g.barSize,M=g.layout,_=g.barGap,E=g.barCategoryGap,R=g.maxBarSize,N=tj(M),j=N.numericAxisName,B=N.cateAxisName,F=eSe(x),$=[];return x.forEach(function(z,T){var q=$0(g.data,{graphicalItems:[z],dataStartIndex:O,dataEndIndex:A}),D=z.type.defaultProps!==void 0?H(H({},z.type.defaultProps),z.props):z.props,I=D.dataKey,Y=D.maxBarSize,G=D["".concat(j,"Id")],te=D["".concat(B,"Id")],fe={},ye=l.reduce(function(Yr,Er){var qs=v["".concat(Er.axisType,"Map")],Ks=D["".concat(Er.axisType,"Id")];qs&&qs[Ks]||Er.axisType==="zAxis"||Qa();var $e=qs[Ks];return H(H({},Yr),{},pe(pe({},Er.axisType,$e),"".concat(Er.axisType,"Ticks"),xa($e)))},fe),Q=ye[B],ue=ye["".concat(B,"Ticks")],me=k&&k[G]&&k[G].hasStack&&nme(z,k[G].stackGroups),X=yo(z.type).indexOf("Bar")>=0,qe=uy(Q,ue),Ce=[],ht=F&&Upe({barSize:P,stackGroups:k,totalSize:nSe(ye,B)});if(X){var st,_t,tn=we(Y)?R:Y,ir=(st=(_t=uy(Q,ue,!0))!==null&&_t!==void 0?_t:tn)!==null&&st!==void 0?st:0;Ce=Hpe({barGap:_,barCategoryGap:E,bandSize:ir!==qe?ir:qe,sizeList:ht[te],maxBarSize:tn}),ir!==qe&&(Ce=Ce.map(function(Yr){return H(H({},Yr),{},{position:H(H({},Yr.position),{},{offset:Yr.position.offset-ir/2})})}))}var Cn=z&&z.type&&z.type.getComposedData;Cn&&$.push({props:H(H({},Cn(H(H({},ye),{},{displayedData:q,props:g,dataKey:I,item:z,bandSize:qe,barPosition:Ce,offset:w,stackedData:me,layout:M,dataStartIndex:O,dataEndIndex:A}))),{},pe(pe(pe({key:z.key||"item-".concat(T)},j,ye[j]),B,ye[B]),"animationId",S)),childIndex:UJ(z,g.children),item:z})}),$},d=function(g,v){var x=g.props,k=g.dataStartIndex,w=g.dataEndIndex,S=g.updateId;if(!b_({props:x}))return null;var O=x.children,A=x.layout,P=x.stackOffset,M=x.data,_=x.reverseStackOrder,E=tj(A),R=E.numericAxisName,N=E.cateAxisName,j=kr(O,r),B=eme(M,j,"".concat(R,"Id"),"".concat(N,"Id"),P,_),F=l.reduce(function(D,I){var Y="".concat(I.axisType,"Map");return H(H({},D),{},pe({},Y,Zwe(x,H(H({},I),{},{graphicalItems:j,stackGroups:I.axisType===R&&B,dataStartIndex:k,dataEndIndex:w}))))},{}),$=tSe(H(H({},F),{},{props:x,graphicalItems:j}),v?.legendBBox);Object.keys(F).forEach(function(D){F[D]=c(x,F[D],$,D.replace("Map",""),n)});var z=F["".concat(N,"Map")],T=Jwe(z),q=h(x,H(H({},F),{},{dataStartIndex:k,dataEndIndex:w,updateId:S,graphicalItems:j,stackGroups:B,offset:$}));return H(H({formattedGraphicalItems:q,graphicalItems:j,offset:$,stackGroups:B},T),F)},p=function(y){function g(v){var x,k,w;return Nwe(this,g),w=$we(this,g,[v]),pe(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),pe(w,"accessibilityManager",new wwe),pe(w,"handleLegendBBoxUpdate",function(S){if(S){var O=w.state,A=O.dataStartIndex,P=O.dataEndIndex,M=O.updateId;w.setState(H({legendBBox:S},d({props:w.props,dataStartIndex:A,dataEndIndex:P,updateId:M},H(H({},w.state),{},{legendBBox:S}))))}}),pe(w,"handleReceiveSyncEvent",function(S,O,A){if(w.props.syncId===S){if(A===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),pe(w,"handleBrushChange",function(S){var O=S.startIndex,A=S.endIndex;if(O!==w.state.dataStartIndex||A!==w.state.dataEndIndex){var P=w.state.updateId;w.setState(function(){return H({dataStartIndex:O,dataEndIndex:A},d({props:w.props,dataStartIndex:O,dataEndIndex:A,updateId:P},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:A})}}),pe(w,"handleMouseEnter",function(S){var O=w.getMouseInfo(S);if(O){var A=H(H({},O),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var P=w.props.onMouseEnter;xe(P)&&P(A,S)}}),pe(w,"triggeredAfterMouseMove",function(S){var O=w.getMouseInfo(S),A=O?H(H({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(A),w.triggerSyncEvent(A);var P=w.props.onMouseMove;xe(P)&&P(A,S)}),pe(w,"handleItemMouseEnter",function(S){w.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),pe(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),pe(w,"handleMouseMove",function(S){S.persist(),w.throttleTriggeredAfterMouseMove(S)}),pe(w,"handleMouseLeave",function(S){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var A=w.props.onMouseLeave;xe(A)&&A(O,S)}),pe(w,"handleOuterEvent",function(S){var O=WJ(S),A=Sr(w.props,"".concat(O));if(O&&xe(A)){var P,M;/.*touch.*/i.test(O)?M=w.getMouseInfo(S.changedTouches[0]):M=w.getMouseInfo(S),A((P=M)!==null&&P!==void 0?P:{},S)}}),pe(w,"handleClick",function(S){var O=w.getMouseInfo(S);if(O){var A=H(H({},O),{},{isTooltipActive:!0});w.setState(A),w.triggerSyncEvent(A);var P=w.props.onClick;xe(P)&&P(A,S)}}),pe(w,"handleMouseDown",function(S){var O=w.props.onMouseDown;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),pe(w,"handleMouseUp",function(S){var O=w.props.onMouseUp;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),pe(w,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),pe(w,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseDown(S.changedTouches[0])}),pe(w,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&w.handleMouseUp(S.changedTouches[0])}),pe(w,"handleDoubleClick",function(S){var O=w.props.onDoubleClick;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),pe(w,"handleContextMenu",function(S){var O=w.props.onContextMenu;if(xe(O)){var A=w.getMouseInfo(S);O(A,S)}}),pe(w,"triggerSyncEvent",function(S){w.props.syncId!==void 0&&Px.emit(Ex,w.props.syncId,S,w.eventEmitterSymbol)}),pe(w,"applySyncEvent",function(S){var O=w.props,A=O.layout,P=O.syncMethod,M=w.state.updateId,_=S.dataStartIndex,E=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)w.setState(H({dataStartIndex:_,dataEndIndex:E},d({props:w.props,dataStartIndex:_,dataEndIndex:E,updateId:M},w.state)));else if(S.activeTooltipIndex!==void 0){var R=S.chartX,N=S.chartY,j=S.activeTooltipIndex,B=w.state,F=B.offset,$=B.tooltipTicks;if(!F)return;if(typeof P=="function")j=P($,S);else if(P==="value"){j=-1;for(var z=0;z<$.length;z++)if($[z].value===S.activeLabel){j=z;break}}var T=H(H({},F),{},{x:F.left,y:F.top}),q=Math.min(R,T.x+T.width),D=Math.min(N,T.y+T.height),I=$[j]&&$[j].value,Y=uk(w.state,w.props.data,j),G=$[j]?{x:A==="horizontal"?$[j].coordinate:q,y:A==="horizontal"?D:$[j].coordinate}:Hz;w.setState(H(H({},S),{},{activeLabel:I,activeCoordinate:G,activePayload:Y,activeTooltipIndex:j}))}else w.setState(S)}),pe(w,"renderCursor",function(S){var O,A=w.state,P=A.isTooltipActive,M=A.activeCoordinate,_=A.activePayload,E=A.offset,R=A.activeTooltipIndex,N=A.tooltipAxisBandSize,j=w.getTooltipEventType(),B=(O=S.props.active)!==null&&O!==void 0?O:P,F=w.props.layout,$=S.key||"_recharts-cursor";return L.createElement(Ewe,{key:$,activeCoordinate:M,activePayload:_,activeTooltipIndex:R,chartName:n,element:S,isActive:B,layout:F,offset:E,tooltipAxisBandSize:N,tooltipEventType:j})}),pe(w,"renderPolarAxis",function(S,O,A){var P=Sr(S,"type.axisType"),M=Sr(w.state,"".concat(P,"Map")),_=S.type.defaultProps,E=_!==void 0?H(H({},_),S.props):S.props,R=M&&M[E["".concat(P,"Id")]];return C.cloneElement(S,H(H({},R),{},{className:Se(P,R.className),key:S.key||"".concat(O,"-").concat(A),ticks:xa(R,!0)}))}),pe(w,"renderPolarGrid",function(S){var O=S.props,A=O.radialLines,P=O.polarAngles,M=O.polarRadius,_=w.state,E=_.radiusAxisMap,R=_.angleAxisMap,N=Tl(E),j=Tl(R),B=j.cx,F=j.cy,$=j.innerRadius,z=j.outerRadius;return C.cloneElement(S,{polarAngles:Array.isArray(P)?P:xa(j,!0).map(function(T){return T.coordinate}),polarRadius:Array.isArray(M)?M:xa(N,!0).map(function(T){return T.coordinate}),cx:B,cy:F,innerRadius:$,outerRadius:z,key:S.key||"polar-grid",radialLines:A})}),pe(w,"renderLegend",function(){var S=w.state.formattedGraphicalItems,O=w.props,A=O.children,P=O.width,M=O.height,_=w.props.margin||{},E=P-(_.left||0)-(_.right||0),R=S4({children:A,formattedGraphicalItems:S,legendWidth:E,legendContent:u});if(!R)return null;var N=R.item,j=YI(R,Twe);return C.cloneElement(N,H(H({},j),{},{chartWidth:P,chartHeight:M,margin:_,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),pe(w,"renderTooltip",function(){var S,O=w.props,A=O.children,P=O.accessibilityLayer,M=dr(A,ri);if(!M)return null;var _=w.state,E=_.isTooltipActive,R=_.activeCoordinate,N=_.activePayload,j=_.activeLabel,B=_.offset,F=(S=M.props.active)!==null&&S!==void 0?S:E;return C.cloneElement(M,{viewBox:H(H({},B),{},{x:B.left,y:B.top}),active:F,label:j,payload:F?N:[],coordinate:R,accessibilityLayer:P})}),pe(w,"renderBrush",function(S){var O=w.props,A=O.margin,P=O.data,M=w.state,_=M.offset,E=M.dataStartIndex,R=M.dataEndIndex,N=M.updateId;return C.cloneElement(S,{key:S.key||"_recharts-brush",onChange:Hp(w.handleBrushChange,S.props.onChange),data:P,x:ne(S.props.x)?S.props.x:_.left,y:ne(S.props.y)?S.props.y:_.top+_.height+_.brushBottom-(A.bottom||0),width:ne(S.props.width)?S.props.width:_.width,startIndex:E,endIndex:R,updateId:"brush-".concat(N)})}),pe(w,"renderReferenceElement",function(S,O,A){if(!S)return null;var P=w,M=P.clipPathId,_=w.state,E=_.xAxisMap,R=_.yAxisMap,N=_.offset,j=S.type.defaultProps||{},B=S.props,F=B.xAxisId,$=F===void 0?j.xAxisId:F,z=B.yAxisId,T=z===void 0?j.yAxisId:z;return C.cloneElement(S,{key:S.key||"".concat(O,"-").concat(A),xAxis:E[$],yAxis:R[T],viewBox:{x:N.left,y:N.top,width:N.width,height:N.height},clipPathId:M})}),pe(w,"renderActivePoints",function(S){var O=S.item,A=S.activePoint,P=S.basePoint,M=S.childIndex,_=S.isRange,E=[],R=O.props.key,N=O.item.type.defaultProps!==void 0?H(H({},O.item.type.defaultProps),O.item.props):O.item.props,j=N.activeDot,B=N.dataKey,F=H(H({index:M,dataKey:B,cx:A.x,cy:A.y,r:4,fill:DA(O.item),strokeWidth:2,stroke:"#fff",payload:A.payload,value:A.value},de(j,!1)),Ng(j));return E.push(g.renderActiveDot(j,F,"".concat(R,"-activePoint-").concat(M))),P?E.push(g.renderActiveDot(j,H(H({},F),{},{cx:P.x,cy:P.y}),"".concat(R,"-basePoint-").concat(M))):_&&E.push(null),E}),pe(w,"renderGraphicChild",function(S,O,A){var P=w.filterFormatItem(S,O,A);if(!P)return null;var M=w.getTooltipEventType(),_=w.state,E=_.isTooltipActive,R=_.tooltipAxis,N=_.activeTooltipIndex,j=_.activeLabel,B=w.props.children,F=dr(B,ri),$=P.props,z=$.points,T=$.isRange,q=$.baseLine,D=P.item.type.defaultProps!==void 0?H(H({},P.item.type.defaultProps),P.item.props):P.item.props,I=D.activeDot,Y=D.hide,G=D.activeBar,te=D.activeShape,fe=!!(!Y&&E&&F&&(I||G||te)),ye={};M!=="axis"&&F&&F.props.trigger==="click"?ye={onClick:Hp(w.handleItemMouseEnter,S.props.onClick)}:M!=="axis"&&(ye={onMouseLeave:Hp(w.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:Hp(w.handleItemMouseEnter,S.props.onMouseEnter)});var Q=C.cloneElement(S,H(H({},P.props),ye));function ue(Er){return typeof R.dataKey=="function"?R.dataKey(Er.payload):null}if(fe)if(N>=0){var me,X;if(R.dataKey&&!R.allowDuplicatedCategory){var qe=typeof R.dataKey=="function"?ue:"payload.".concat(R.dataKey.toString());me=Rg(z,qe,j),X=T&&q&&Rg(q,qe,j)}else me=z?.[N],X=T&&q&&q[N];if(te||G){var Ce=S.props.activeIndex!==void 0?S.props.activeIndex:N;return[C.cloneElement(S,H(H(H({},P.props),ye),{},{activeIndex:Ce})),null,null]}if(!we(me))return[Q].concat(sc(w.renderActivePoints({item:P,activePoint:me,basePoint:X,childIndex:N,isRange:T})))}else{var ht,st=(ht=w.getItemByXY(w.state.activeCoordinate))!==null&&ht!==void 0?ht:{graphicalItem:Q},_t=st.graphicalItem,tn=_t.item,ir=tn===void 0?S:tn,Cn=_t.childIndex,Yr=H(H(H({},P.props),ye),{},{activeIndex:Cn});return[C.cloneElement(ir,Yr),null,null]}return T?[Q,null,null]:[Q,null]}),pe(w,"renderCustomized",function(S,O,A){return C.cloneElement(S,H(H({key:"recharts-customized-".concat(A)},w.props),w.state))}),pe(w,"renderMap",{CartesianGrid:{handler:Qp,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:Qp},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:Qp},YAxis:{handler:Qp},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=v.id)!==null&&x!==void 0?x:Ec("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=w3(w.triggeredAfterMouseMove,(k=v.throttleDelay)!==null&&k!==void 0?k:1e3/60),w.state={},w}return zwe(g,y),Lwe(g,[{key:"componentDidMount",value:function(){var x,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,k=x.children,w=x.data,S=x.height,O=x.layout,A=dr(k,ri);if(A){var P=A.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var M=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,_=uk(this.state,w,P,M),E=this.state.tooltipTicks[P].coordinate,R=(this.state.offset.top+S)/2,N=O==="horizontal",j=N?{x:E,y:R}:{y:E,x:R},B=this.state.formattedGraphicalItems.find(function($){var z=$.item;return z.type.name==="Scatter"});B&&(j=H(H({},j),B.props.points[P].tooltipPosition),_=B.props.points[P].tooltipPayload);var F={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:M,activePayload:_,activeCoordinate:j};this.setState(F),this.renderCursor(A),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,S;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(x){Lw([dr(x.children,ri)],[dr(this.props.children,ri)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=dr(this.props.children,ri);if(x&&typeof x.props.shared=="boolean"){var k=x.props.shared?"axis":"item";return a.indexOf(k)>=0?k:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var k=this.container,w=k.getBoundingClientRect(),S=gce(w),O={chartX:Math.round(x.pageX-S.left),chartY:Math.round(x.pageY-S.top)},A=w.width/k.offsetWidth||1,P=this.inRange(O.chartX,O.chartY,A);if(!P)return null;var M=this.state,_=M.xAxisMap,E=M.yAxisMap,R=this.getTooltipEventType(),N=JI(this.state,this.props.data,this.props.layout,P);if(R!=="axis"&&_&&E){var j=Tl(_).scale,B=Tl(E).scale,F=j&&j.invert?j.invert(O.chartX):null,$=B&&B.invert?B.invert(O.chartY):null;return H(H({},O),{},{xValue:F,yValue:$},N)}return N?H(H({},O),N):null}},{key:"inRange",value:function(x,k){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,O=x/w,A=k/w;if(S==="horizontal"||S==="vertical"){var P=this.state.offset,M=O>=P.left&&O<=P.left+P.width&&A>=P.top&&A<=P.top+P.height;return M?{x:O,y:A}:null}var _=this.state,E=_.angleAxisMap,R=_.radiusAxisMap;if(E&&R){var N=Tl(E);return TM({x:O,y:A},N)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,k=this.getTooltipEventType(),w=dr(x,ri),S={};w&&k==="axis"&&(w.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Ng(this.props,this.handleOuterEvent);return H(H({},O),S)}},{key:"addListener",value:function(){Px.on(Ex,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Px.removeListener(Ex,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,k,w){for(var S=this.state.formattedGraphicalItems,O=0,A=S.length;O<A;O++){var P=S[O];if(P.item===x||P.props.key===x.key||k===yo(P.item.type)&&w===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,k=this.state.offset,w=k.left,S=k.top,O=k.height,A=k.width;return L.createElement("defs",null,L.createElement("clipPath",{id:x},L.createElement("rect",{x:w,y:S,height:O,width:A})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(k,w){var S=XI(w,2),O=S[0],A=S[1];return H(H({},k),{},pe({},O,A.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(k,w){var S=XI(w,2),O=S[0],A=S[1];return H(H({},k),{},pe({},O,A.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(x){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[x])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(x){var k=this.state,w=k.formattedGraphicalItems,S=k.activeItem;if(w&&w.length)for(var O=0,A=w.length;O<A;O++){var P=w[O],M=P.props,_=P.item,E=_.type.defaultProps!==void 0?H(H({},_.type.defaultProps),_.props):_.props,R=yo(_.type);if(R==="Bar"){var N=(M.data||[]).find(function($){return rve(x,$)});if(N)return{graphicalItem:P,payload:N}}else if(R==="RadialBar"){var j=(M.data||[]).find(function($){return TM(x,$)});if(j)return{graphicalItem:P,payload:j}}else if(_0(P,S)||M0(P,S)||cd(P,S)){var B=V0e({graphicalItem:P,activeTooltipItem:S,itemData:E.data}),F=E.activeIndex===void 0?B:E.activeIndex;return{graphicalItem:H(H({},P),{},{childIndex:F}),payload:cd(P,S)?E.data[B]:P.props.data[B]}}}return null}},{key:"render",value:function(){var x=this;if(!b_(this))return null;var k=this.props,w=k.children,S=k.className,O=k.width,A=k.height,P=k.style,M=k.compact,_=k.title,E=k.desc,R=YI(k,_we),N=de(R,!1);if(M)return L.createElement(RI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(Bw,Yl({},N,{width:O,height:A,title:_,desc:E}),this.renderClipPath(),w_(w,this.renderMap)));if(this.props.accessibilityLayer){var j,B;N.tabIndex=(j=this.props.tabIndex)!==null&&j!==void 0?j:0,N.role=(B=this.props.role)!==null&&B!==void 0?B:"application",N.onKeyDown=function($){x.accessibilityManager.keyboardEvent($)},N.onFocus=function(){x.accessibilityManager.focus()}}var F=this.parseEventsOfWrapper();return L.createElement(RI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",Yl({className:Se("recharts-wrapper",S),style:H({position:"relative",cursor:"default",width:O,height:A},P)},F,{ref:function(z){x.container=z}}),L.createElement(Bw,Yl({},N,{width:O,height:A,title:_,desc:E,style:Kwe}),this.renderClipPath(),w_(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(C.Component);pe(p,"displayName",n),pe(p,"defaultProps",H({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),pe(p,"getDerivedStateFromProps",function(y,g){var v=y.dataKey,x=y.data,k=y.children,w=y.width,S=y.height,O=y.layout,A=y.stackOffset,P=y.margin,M=g.dataStartIndex,_=g.dataEndIndex;if(g.updateId===void 0){var E=ej(y);return H(H(H({},E),{},{updateId:0},d(H(H({props:y},E),{},{updateId:0}),g)),{},{prevDataKey:v,prevData:x,prevWidth:w,prevHeight:S,prevLayout:O,prevStackOffset:A,prevMargin:P,prevChildren:k})}if(v!==g.prevDataKey||x!==g.prevData||w!==g.prevWidth||S!==g.prevHeight||O!==g.prevLayout||A!==g.prevStackOffset||!hu(P,g.prevMargin)){var R=ej(y),N={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},j=H(H({},JI(g,x,O)),{},{updateId:g.updateId+1}),B=H(H(H({},R),N),j);return H(H(H({},B),d(H({props:y},B),g)),{},{prevDataKey:v,prevData:x,prevWidth:w,prevHeight:S,prevLayout:O,prevStackOffset:A,prevMargin:P,prevChildren:k})}if(!Lw(k,g.prevChildren)){var F,$,z,T,q=dr(k,Xu),D=q&&(F=($=q.props)===null||$===void 0?void 0:$.startIndex)!==null&&F!==void 0?F:M,I=q&&(z=(T=q.props)===null||T===void 0?void 0:T.endIndex)!==null&&z!==void 0?z:_,Y=D!==M||I!==_,G=!we(x),te=G&&!Y?g.updateId:g.updateId+1;return H(H({updateId:te},d(H(H({props:y},g),{},{updateId:te,dataStartIndex:D,dataEndIndex:I}),g)),{},{prevChildren:k,dataStartIndex:D,dataEndIndex:I})}return null}),pe(p,"renderActiveDot",function(y,g,v){var x;return C.isValidElement(y)?x=C.cloneElement(y,g):xe(y)?x=y(g):x=L.createElement(C0,g),L.createElement(je,{className:"recharts-active-dot",key:v},x)});var m=C.forwardRef(function(g,v){return L.createElement(p,Yl({},g,{ref:v}))});return m.displayName=p.displayName,m},rSe=WA({chartName:"LineChart",GraphicalChild:tp,axisComponents:[{axisType:"xAxis",AxisComp:Nc},{axisType:"yAxis",AxisComp:Dc}],formatAxisMap:lz}),iSe=WA({chartName:"BarChart",GraphicalChild:cl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Nc},{axisType:"yAxis",AxisComp:Dc}],formatAxisMap:lz}),oSe=WA({chartName:"PieChart",GraphicalChild:Fo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:T0},{axisType:"radiusAxis",AxisComp:P0}],formatAxisMap:hme,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function qz({ratio:e}){const t=Math.round(e*100),n=[{name:"hit",value:t},{name:"miss",value:100-t}];return b.jsxs("div",{className:"relative",style:{width:140,height:140},children:[b.jsx(oSe,{width:140,height:140,children:b.jsxs(Fo,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:48,outerRadius:62,startAngle:90,endAngle:-270,stroke:"none",children:[b.jsx(Fu,{fill:"var(--color-ok)"}),b.jsx(Fu,{fill:"var(--gray-5)"})]})}),b.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[b.jsxs("span",{className:"text-[20px] font-semibold tabular text-[var(--color-text)]",children:[t,"%"]}),b.jsx("span",{className:"text-[11px] text-[var(--color-text-muted)]",children:"cache hit"})]})]})}function Kz({runs:e}){const n=e.slice(0,20).reverse().map((r,i)=>({n:i+1,sec:Math.round(r.durationMs/1e3*10)/10}));return n.length===0?null:b.jsx("div",{className:"h-[140px] w-full min-w-0",children:b.jsx(S3,{width:"100%",height:"100%",children:b.jsxs(iSe,{data:n,margin:{top:8,right:8,left:0,bottom:0},children:[b.jsx(Nc,{dataKey:"n",hide:!0,stroke:"var(--gray-5)"}),b.jsx(Dc,{hide:!0,domain:[0,"auto"],stroke:"var(--gray-5)"}),b.jsx(ri,{contentStyle:{background:"var(--color-surface)",border:"1px solid var(--color-border-strong)",borderRadius:"8px"},labelFormatter:r=>`Run ${r}`,formatter:r=>[`${r}s`,"Duration"]}),b.jsx(cl,{dataKey:"sec",radius:[4,4,0,0],maxBarSize:28,children:n.map((r,i)=>b.jsx(Fu,{fill:i===n.length-1?"var(--color-ok)":"var(--color-text-muted)"},`cell-${i}`))})]})})})}function Gz({runs:e}){const n=e.slice(0,20).reverse().map((r,i)=>({n:i+1,tokens:r.inputTokens+r.outputTokens}));return n.length===0?null:b.jsx("div",{className:"h-[140px] w-full min-w-0",children:b.jsx(S3,{width:"100%",height:"100%",children:b.jsxs(rSe,{data:n,margin:{top:8,right:8,left:0,bottom:0},children:[b.jsx(Nc,{dataKey:"n",hide:!0,stroke:"var(--gray-5)"}),b.jsx(Dc,{hide:!0,domain:["auto","auto"],stroke:"var(--gray-5)"}),b.jsx(ri,{contentStyle:{background:"var(--color-surface)",border:"1px solid var(--color-border-strong)",borderRadius:"8px"},labelFormatter:r=>`Run ${r}`,formatter:r=>[`${r.toLocaleString()} tokens`,"Total"]}),b.jsx(tp,{type:"monotone",dataKey:"tokens",stroke:"var(--color-text)",strokeWidth:2,dot:!1,activeDot:{r:4,fill:"var(--color-text)"}})]})})})}function sSe(e){const t=new Map;for(const n of e){const r=t.get(n.feature)??[];r.push(n),t.set(n.feature,r)}for(const n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function aSe(){const e=Qi();C.useEffect(()=>{Be("/api/projects/touch",{method:"POST"}).then(()=>e.invalidateQueries({queryKey:["recent-projects"]}))},[e]);const t=Jt({queryKey:["dashboard"],queryFn:()=>Be("/api/dashboard")}),n=t.error,r=n instanceof $r;if(r)return b.jsx(Fe,{title:"Dashboard",description:"Overview of this workspace and recent planner telemetry.",children:b.jsxs(Ge,{tone:"warning",title:n instanceof $r?n.message:new $r().message,children:["Reopen ",b.jsx(Fi,{children:"squad console"})," from your project and use the new URL."]})});const i=!r&&n?String(n):null,o=t.data,s=o?.lastRun??null,a=s?.stats.cacheHitRatio??0,l=s!=null?`${Math.round(a*100)}%`:"—",u=o?.runs??[],c=o?.stories?sSe(o.stories):null;return b.jsxs(Fe,{title:"Dashboard",description:"Overview of this workspace and recent planner telemetry.",children:[i?b.jsx(Ge,{tone:"danger",children:i}):null,b.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[b.jsxs(nt,{variant:"default",children:[b.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-[var(--color-text-dim)]",children:"Project"}),t.isPending?b.jsx(Nr,{className:"mt-2 h-8 w-3/4"}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"mt-2 text-lg font-semibold text-[var(--color-text)]",children:o?.project.name??"—"}),o?.project.primaryLanguage?b.jsx("div",{className:"mt-1 text-sm text-[var(--color-text-muted)]",children:o.project.primaryLanguage}):null,o?.root?b.jsx("div",{className:"mt-3 truncate font-mono text-[11px] text-[var(--color-text-dim)]",children:o.root}):null]})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-[var(--color-text-dim)]",children:"Planner"}),t.isPending?b.jsx(Nr,{className:"mt-2 h-8 w-2/3"}):o?.planner?b.jsxs("div",{className:"mt-2 flex items-center gap-2 text-lg font-semibold",children:[o.planner.enabled?b.jsx("span",{className:"h-2 w-2 rounded-full bg-[var(--color-accent)] shadow-[0_0_10px_var(--color-accent)]"}):null,b.jsx("span",{children:o.planner.provider})]}):b.jsx("div",{className:"mt-2 text-lg font-semibold text-[var(--color-text-muted)]",children:"not configured"})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("div",{className:"text-xs font-medium uppercase tracking-wide text-[var(--color-text-dim)]",children:"Last cache hit"}),t.isPending?b.jsx(Nr,{className:"mt-2 h-8 w-20"}):b.jsx("div",{className:"mt-2 text-2xl font-semibold tabular-nums text-[var(--color-text)]",children:l})]})]}),b.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:u.length===0?b.jsxs(nt,{variant:"default",className:"lg:col-span-3",children:[b.jsx("h2",{className:"mb-2 text-lg font-semibold text-[var(--color-text)]",children:"Run history"}),b.jsxs("p",{className:"text-sm text-[var(--color-text-muted)]",children:["No runs yet — kick one off in"," ",b.jsx(ln,{to:"/generate",className:"text-[var(--color-accent)] hover:underline",children:"Generate"}),"."]})]}):b.jsxs(b.Fragment,{children:[b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--color-text)]",children:"Cache hit ratio"}),b.jsx("div",{className:"flex justify-center",children:b.jsx(qz,{ratio:a})})]}),b.jsxs(nt,{variant:"default",children:[b.jsxs("h2",{className:"mb-4 text-sm font-semibold text-[var(--color-text)]",children:["Token spend (last ",Math.min(20,u.length)," runs)"]}),b.jsx(Gz,{runs:u})]}),b.jsxs(nt,{variant:"default",children:[b.jsxs("h2",{className:"mb-4 text-sm font-semibold text-[var(--color-text)]",children:["Run duration (last ",Math.min(20,u.length)," runs)"]}),b.jsx(Kz,{runs:u})]})]})}),b.jsxs(nt,{variant:"default",children:[b.jsx("div",{className:"mb-4",children:b.jsx("h2",{className:"text-lg font-semibold text-[var(--color-text)]",children:"Stories"})}),t.isPending?b.jsxs("div",{className:"space-y-3",children:[b.jsx(Nr,{className:"h-10 w-full"}),b.jsx(Nr,{className:"h-10 w-full"})]}):c&&c.size>0?b.jsx("div",{className:"space-y-6",children:[...c.entries()].sort((f,h)=>f[0].localeCompare(h[0])).map(([f,h])=>b.jsxs("div",{children:[b.jsx("div",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:f}),b.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:h.map((d,p)=>b.jsx("li",{children:b.jsxs(ln,{to:"/stories/$feature/$id",params:{feature:d.feature,id:d.id},className:"flex items-center gap-3 px-3 py-[var(--space-row-y)] text-[13px] hover:bg-[var(--gray-4)] transition-colors "+(p>0?"border-t border-[var(--color-border)]":""),children:[b.jsx("span",{className:"w-20 shrink-0 font-mono text-[12px] text-[var(--color-text-muted)]",children:d.id}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.titleHint||b.jsx("span",{className:"text-[var(--color-text-dim)]",children:"no title"})}),d.planFile?b.jsx(Et,{tone:"success",dot:!0,children:"planned"}):b.jsx(Et,{tone:"default",children:"unplanned"})]})},`${d.feature}/${d.id}`))})]},f))}):b.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No stories yet."})]})]})}const ut=C.forwardRef(function({leftSlot:t,rightSlot:n,invalid:r,className:i="",...o},s){return b.jsxs("div",{"data-invalid":r||void 0,className:`flex w-full items-center gap-2 rounded-[var(--radius-md)] border bg-[var(--gray-2)] px-3 py-2 text-sm border-[var(--color-border)] focus-within:border-[var(--color-border-strong)] data-[invalid]:border-[var(--color-fail)] transition-colors ${i}`,children:[t?b.jsx("span",{className:"text-[var(--color-text-dim)]",children:t}):null,b.jsx("input",{ref:s,className:"flex-1 bg-transparent text-[var(--color-text)] placeholder:text-[var(--color-text-dim)] outline-none",...o}),n?b.jsx("span",{className:"text-[var(--color-text-dim)]",children:n}):null]})}),ac=C.forwardRef(function({className:t="",children:n,...r},i){return b.jsxs("div",{className:`relative w-full ${t}`,children:[b.jsx("select",{ref:i,className:`
333
+ w-full appearance-none rounded-[var(--radius-md)] border border-[var(--color-border)]
334
+ bg-[var(--gray-2)] px-3 py-2 pr-9 text-sm text-[var(--color-text)]
335
+ outline-none focus:border-[var(--color-border-strong)]
336
+ transition-colors
337
+ `,...r,children:n}),b.jsx(qB,{size:14,className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-dim)]","aria-hidden":!0})]})});function nj(e){return e.toLowerCase().trim().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,80)}const mf="__new__";function lSe(e){switch(e){case"jira":return"Jira issue id";case"azure":return"Azure work item id";case"linear":return"Linear issue id";case"github":return"GitHub issue id";default:return"Work item id"}}function uSe({open:e,onOpenChange:t}){const n=mi(),r=Qi(),i=Jt({queryKey:["meta"],queryFn:()=>Be("/api/meta")}),o=Jt({queryKey:["stories"],queryFn:()=>Be("/api/stories")}),[s,a]=C.useState(mf),[l,u]=C.useState(""),[c,f]=C.useState(""),[h,d]=C.useState(""),p=C.useMemo(()=>{const v=new Set;for(const x of o.data??[])v.add(x.feature);return[...v].sort()},[o.data]),m=Wa({mutationFn:()=>{const x={feature:s===mf?nj(l.trim())||"feature":s,title:c.trim()||void 0};return h.trim()&&(x.trackerId=h.trim()),Be("/api/stories",{method:"POST",body:JSON.stringify(x)})},onSuccess:v=>{r.invalidateQueries({queryKey:["stories"]}),t(!1),f(""),d(""),u(""),a(mf),n({to:"/stories/$feature/$id",params:{feature:v.feature,id:v.id}})}}),y=i.data?.tracker.type??"none",g=y!=="none";return b.jsx(Sc,{open:e,onClose:()=>t(!1),title:"New story",footer:b.jsxs("div",{className:"flex w-full justify-end gap-2",children:[b.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>t(!1),children:"Cancel"}),b.jsx(be,{type:"button",disabled:m.isPending,onClick:()=>{m.mutate()},children:"Create"})]}),children:b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{children:[b.jsx("div",{className:"mb-1 text-xs text-[var(--color-text-dim)]",children:"Feature"}),b.jsxs(ac,{value:s,onChange:v=>a(v.target.value),disabled:!o.data&&o.isLoading,children:[p.map(v=>b.jsx("option",{value:v,children:v},v)),b.jsx("option",{value:mf,children:"New feature…"})]}),s===mf&&b.jsx("div",{className:"mt-2",children:b.jsx(ut,{placeholder:"kebab-case feature slug",value:l,onChange:v=>u(v.target.value),onBlur:()=>u(v=>nj(v))})})]}),b.jsxs("div",{children:[b.jsx("div",{className:"mb-1 text-xs text-[var(--color-text-dim)]",children:"Title (optional if tracker id set)"}),b.jsx(ut,{value:c,onChange:v=>f(v.target.value),placeholder:"Short title"})]}),g&&b.jsxs("div",{children:[b.jsxs("div",{className:"mb-1 text-xs text-[var(--color-text-dim)]",children:[lSe(y)," (optional)"]}),b.jsx(ut,{value:h,onChange:v=>d(v.target.value),placeholder:"Leave empty to create without a tracker link"})]}),m.isError&&b.jsx("p",{className:"text-sm text-[var(--color-fail)]",children:m.error.message})]})})}function Qz(e){const t=new Map;for(const n of e){const r=t.get(n.feature)??[];r.push(n),t.set(n.feature,r)}return[...t.entries()].sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>({feature:n,stories:r.sort((i,o)=>i.id.localeCompare(o.id))}))}function cSe(){const e=Jt({queryKey:["stories"],queryFn:()=>Be("/api/stories")}),[t,n]=C.useState(!1),r=mi();if(C.useEffect(()=>{const o=()=>n(!0);return window.addEventListener("squad:dialog:new-story",o),()=>window.removeEventListener("squad:dialog:new-story",o)},[]),e.isLoading)return b.jsx(Fe,{title:"Stories",description:"Intake files grouped by feature. Open a story to edit or run the planner.",children:b.jsx("div",{className:"space-y-2",children:Array.from({length:8}).map((o,s)=>b.jsx(Nr,{className:"h-9"},s))})});if(e.isError)return b.jsx(Fe,{title:"Stories",description:"Intake files grouped by feature. Open a story to edit or run the planner.",children:b.jsx(Ge,{tone:"danger",children:e.error.message})});const i=Qz(e.data??[]);return b.jsxs(Fe,{title:"Stories",description:"Intake files grouped by feature. Open a story to edit or run the planner.",actions:b.jsx(be,{type:"button",leftIcon:b.jsx($C,{size:14}),onClick:()=>n(!0),children:"New story"}),children:[i.length===0?b.jsxs(Ge,{tone:"info",children:["No stories yet."," ",b.jsx(be,{variant:"ghost",size:"sm",onClick:()=>n(!0),children:"Create one"})," ","to get started."]}):b.jsx("div",{className:"space-y-8",children:i.map(({feature:o,stories:s})=>b.jsxs("div",{children:[b.jsx("div",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:o}),b.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:s.map((a,l)=>b.jsxs("li",{className:"flex items-center gap-3 border-[var(--color-border)] px-3 py-[var(--space-row-y)] text-[13px] "+(l>0?"border-t":""),children:[b.jsx("span",{className:"w-20 shrink-0 font-mono text-[12px] text-[var(--color-text-muted)]",children:a.id}),b.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.titleHint||b.jsx("span",{className:"text-[var(--color-text-dim)]",children:"no title"})}),a.planFile?b.jsx(Et,{tone:"success",dot:!0,children:"planned"}):b.jsx(Et,{tone:"default",children:"unplanned"}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[b.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:()=>void r({to:"/generate",search:{feature:a.feature,storyId:a.id}}),children:"Generate"}),b.jsx(be,{type:"button",variant:"secondary",size:"sm",onClick:()=>void r({to:"/stories/$feature/$id",params:{feature:a.feature,id:a.id}}),children:"Open"})]})]},a.id))})]},o))}),b.jsx(uSe,{open:t,onOpenChange:n})]})}function fSe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hSe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dSe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pSe={};function rj(e,t){return(pSe.jsx?dSe:hSe).test(e)}const mSe=/[ \t\n\f\r]/g;function gSe(e){return typeof e=="object"?e.type==="text"?ij(e.value):!1:ij(e)}function ij(e){return e.replace(mSe,"")===""}let np=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};np.prototype.normal={};np.prototype.property={};np.prototype.space=void 0;function Xz(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new np(n,r,t)}function ck(e){return e.toLowerCase()}class rr{constructor(t,n){this.attribute=n,this.property=t}}rr.prototype.attribute="";rr.prototype.booleanish=!1;rr.prototype.boolean=!1;rr.prototype.commaOrSpaceSeparated=!1;rr.prototype.commaSeparated=!1;rr.prototype.defined=!1;rr.prototype.mustUseProperty=!1;rr.prototype.number=!1;rr.prototype.overloadedBoolean=!1;rr.prototype.property="";rr.prototype.spaceSeparated=!1;rr.prototype.space=void 0;let ySe=0;const Oe=fl(),It=fl(),fk=fl(),J=fl(),Ze=fl(),gu=fl(),cr=fl();function fl(){return 2**++ySe}const hk=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:It,commaOrSpaceSeparated:cr,commaSeparated:gu,number:J,overloadedBoolean:fk,spaceSeparated:Ze},Symbol.toStringTag,{value:"Module"})),_x=Object.keys(hk);class UA extends rr{constructor(t,n,r,i){let o=-1;if(super(t,n),oj(this,"space",i),typeof r=="number")for(;++o<_x.length;){const s=_x[o];oj(this,_x[o],(r&hk[s])===hk[s])}}}UA.prototype.defined=!0;function oj(e,t,n){n&&(e[t]=n)}function Lc(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new UA(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[ck(r)]=r,n[ck(o.attribute)]=r}return new np(t,n,e.space)}const Yz=Lc({properties:{ariaActiveDescendant:null,ariaAtomic:It,ariaAutoComplete:null,ariaBusy:It,ariaChecked:It,ariaColCount:J,ariaColIndex:J,ariaColSpan:J,ariaControls:Ze,ariaCurrent:null,ariaDescribedBy:Ze,ariaDetails:null,ariaDisabled:It,ariaDropEffect:Ze,ariaErrorMessage:null,ariaExpanded:It,ariaFlowTo:Ze,ariaGrabbed:It,ariaHasPopup:null,ariaHidden:It,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ze,ariaLevel:J,ariaLive:null,ariaModal:It,ariaMultiLine:It,ariaMultiSelectable:It,ariaOrientation:null,ariaOwns:Ze,ariaPlaceholder:null,ariaPosInSet:J,ariaPressed:It,ariaReadOnly:It,ariaRelevant:null,ariaRequired:It,ariaRoleDescription:Ze,ariaRowCount:J,ariaRowIndex:J,ariaRowSpan:J,ariaSelected:It,ariaSetSize:J,ariaSort:null,ariaValueMax:J,ariaValueMin:J,ariaValueNow:J,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Zz(e,t){return t in e?e[t]:t}function Jz(e,t){return Zz(e,t.toLowerCase())}const vSe=Lc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gu,acceptCharset:Ze,accessKey:Ze,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:Ze,autoFocus:Oe,autoPlay:Oe,blocking:Ze,capture:null,charSet:null,checked:Oe,cite:null,className:Ze,cols:J,colSpan:null,content:null,contentEditable:It,controls:Oe,controlsList:Ze,coords:J|gu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:fk,draggable:It,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:Ze,height:J,hidden:fk,high:J,href:null,hrefLang:null,htmlFor:Ze,httpEquiv:Ze,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:Ze,itemRef:Ze,itemScope:Oe,itemType:Ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:J,manifest:null,max:null,maxLength:J,media:null,method:null,min:null,minLength:J,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oe,optimum:J,pattern:null,ping:Ze,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:Ze,required:Oe,reversed:Oe,rows:J,rowSpan:J,sandbox:Ze,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shape:null,size:J,sizes:null,slot:null,span:J,spellCheck:It,src:null,srcDoc:null,srcLang:null,srcSet:null,start:J,step:null,style:null,tabIndex:J,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:It,width:J,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ze,axis:null,background:null,bgColor:null,border:J,borderColor:null,bottomMargin:J,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:J,leftMargin:J,link:null,longDesc:null,lowSrc:null,marginHeight:J,marginWidth:J,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:J,rules:null,scheme:null,scrolling:It,standby:null,summary:null,text:null,topMargin:J,valueType:null,version:null,vAlign:null,vLink:null,vSpace:J,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oe,disableRemotePlayback:Oe,prefix:null,property:null,results:J,security:null,unselectable:null},space:"html",transform:Jz}),bSe=Lc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:cr,accentHeight:J,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:J,amplitude:J,arabicForm:null,ascent:J,attributeName:null,attributeType:null,azimuth:J,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:J,by:null,calcMode:null,capHeight:J,className:Ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:J,diffuseConstant:J,direction:null,display:null,dur:null,divisor:J,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:J,enableBackground:null,end:null,event:null,exponent:J,externalResourcesRequired:null,fill:null,fillOpacity:J,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gu,g2:gu,glyphName:gu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:J,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:J,horizOriginX:J,horizOriginY:J,id:null,ideographic:J,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:J,k:J,k1:J,k2:J,k3:J,k4:J,kernelMatrix:cr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:J,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:J,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:J,overlineThickness:J,paintOrder:null,panose1:null,path:null,pathLength:J,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:J,pointsAtY:J,pointsAtZ:J,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cr,rev:cr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cr,requiredFeatures:cr,requiredFonts:cr,requiredFormats:cr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:J,specularExponent:J,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:J,strikethroughThickness:J,string:null,stroke:null,strokeDashArray:cr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:J,strokeOpacity:J,strokeWidth:null,style:null,surfaceScale:J,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cr,tabIndex:J,tableValues:null,target:null,targetX:J,targetY:J,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:J,underlineThickness:J,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:J,values:null,vAlphabetic:J,vMathematical:J,vectorEffect:null,vHanging:J,vIdeographic:J,version:null,vertAdvY:J,vertOriginX:J,vertOriginY:J,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:J,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Zz}),e5=Lc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),t5=Lc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jz}),n5=Lc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xSe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},wSe=/[A-Z]/g,sj=/-[a-z]/g,SSe=/^data[-\w.:]+$/i;function kSe(e,t){const n=ck(t);let r=t,i=rr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&SSe.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(sj,CSe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!sj.test(o)){let s=o.replace(wSe,OSe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=UA}return new i(r,t)}function OSe(e){return"-"+e.toLowerCase()}function CSe(e){return e.charAt(1).toUpperCase()}const ASe=Xz([Yz,vSe,e5,t5,n5],"html"),HA=Xz([Yz,bSe,e5,t5,n5],"svg");function PSe(e){return e.join(" ").trim()}var VA={},aj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ESe=/\n/g,TSe=/^\s*/,_Se=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,MSe=/^:\s*/,ISe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,jSe=/^[;\s]*/,RSe=/^\s+|\s+$/g,NSe=`
338
+ `,lj="/",uj="*",aa="",DSe="comment",LSe="declaration";function $Se(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(ESe);m&&(n+=m.length);var y=p.lastIndexOf(NSe);r=~y?p.length-y:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new s(p),u(),m}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function u(){l(TSe)}function c(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(lj!=e.charAt(0)||uj!=e.charAt(1))){for(var m=2;aa!=e.charAt(m)&&(uj!=e.charAt(m)||lj!=e.charAt(m+1));)++m;if(m+=2,aa===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,p({type:DSe,comment:y})}}function h(){var p=o(),m=l(_Se);if(m){if(f(),!l(MSe))return a("property missing ':'");var y=l(ISe),g=p({type:LSe,property:cj(m[0].replace(aj,aa)),value:y?cj(y[0].replace(aj,aa)):aa});return l(jSe),g}}function d(){var p=[];c(p);for(var m;m=h();)m!==!1&&(p.push(m),c(p));return p}return u(),d()}function cj(e){return e?e.replace(RSe,aa):aa}var BSe=$Se,FSe=Jo&&Jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(VA,"__esModule",{value:!0});VA.default=WSe;const zSe=FSe(BSe);function WSe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,zSe.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var B0={};Object.defineProperty(B0,"__esModule",{value:!0});B0.camelCase=void 0;var USe=/^--[a-zA-Z0-9_-]+$/,HSe=/-([a-z])/g,VSe=/^[^-]+$/,qSe=/^-(webkit|moz|ms|o|khtml)-/,KSe=/^-(ms)-/,GSe=function(e){return!e||VSe.test(e)||USe.test(e)},QSe=function(e,t){return t.toUpperCase()},fj=function(e,t){return"".concat(t,"-")},XSe=function(e,t){return t===void 0&&(t={}),GSe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(KSe,fj):e=e.replace(qSe,fj),e.replace(HSe,QSe))};B0.camelCase=XSe;var YSe=Jo&&Jo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ZSe=YSe(VA),JSe=B0;function dk(e,t){var n={};return!e||typeof e!="string"||(0,ZSe.default)(e,function(r,i){r&&i&&(n[(0,JSe.camelCase)(r,t)]=i)}),n}dk.default=dk;var eke=dk;const tke=De(eke),r5=i5("end"),qA=i5("start");function i5(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function nke(e){const t=qA(e),n=r5(e);if(t&&n)return{start:t,end:n}}function Zf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hj(e.position):"start"in e||"end"in e?hj(e):"line"in e||"column"in e?pk(e):""}function pk(e){return dj(e&&e.line)+":"+dj(e&&e.column)}function hj(e){return pk(e&&e.start)+"-"+pk(e&&e.end)}function dj(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Zf(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const KA={}.hasOwnProperty,rke=new Map,ike=/[A-Z]/g,oke=new Set(["table","tbody","thead","tfoot","tr"]),ske=new Set(["td","th"]),o5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ake(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=mke(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=pke(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?HA:ASe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=s5(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function s5(e,t,n){if(t.type==="element")return lke(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uke(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fke(e,t,n);if(t.type==="mdxjsEsm")return cke(e,t);if(t.type==="root")return hke(e,t,n);if(t.type==="text")return dke(e,t)}function lke(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=HA,e.schema=i),e.ancestors.push(t);const o=l5(e,t.tagName,!1),s=gke(e,t);let a=QA(e,t);return oke.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!gSe(l):!0})),a5(e,s,o,t),GA(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function uke(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}yd(e,t.position)}function cke(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yd(e,t.position)}function fke(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=HA,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:l5(e,t.name,!0),s=yke(e,t),a=QA(e,t);return a5(e,s,o,t),GA(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function hke(e,t,n){const r={};return GA(r,QA(e,t)),e.create(t,e.Fragment,r,n)}function dke(e,t){return t.value}function a5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function GA(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function pke(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function mke(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=qA(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function gke(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&KA.call(t.properties,i)){const o=vke(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&ske.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function yke(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else yd(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else yd(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function QA(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:rke;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=s5(e,o,s);a!==void 0&&n.push(a)}return n}function vke(e,t,n){const r=kSe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?fSe(n):PSe(n)),r.property==="style"){let i=typeof n=="object"?n:bke(e,String(n));return e.stylePropertyNameCase==="css"&&(i=xke(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?xSe[r.property]||r.property:r.attribute,n]}}function bke(e,t){try{return tke(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=o5+"#cannot-parse-style-attribute",i}}function l5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=rj(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=rj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return KA.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);yd(e)}function yd(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=o5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xke(e){const t={};let n;for(n in e)KA.call(e,n)&&(t[wke(n)]=e[n]);return t}function wke(e){let t=e.replace(ike,Ske);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ske(e){return"-"+e.toLowerCase()}const Mx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},kke={};function Oke(e,t){const n=kke,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return u5(e,r,i)}function u5(e,t,n){if(Cke(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return pj(e.children,t,n)}return Array.isArray(e)?pj(e,t,n):""}function pj(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=u5(e[i],t,n);return r.join("")}function Cke(e){return!!(e&&typeof e=="object")}const mj=document.createElement("i");function XA(e){const t="&"+e+";";mj.innerHTML=t;const n=mj.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Rr(e,t){return e.length>0?(Gi(e,e.length,0,t),e):t}const gj={}.hasOwnProperty;function Ake(e){const t={};let n=-1;for(;++n<e.length;)Pke(t,e[n]);return t}function Pke(e,t){let n;for(n in t){const i=(gj.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){gj.call(i,s)||(i[s]=[]);const a=o[s];Eke(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Eke(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gi(e,0,0,r)}function c5(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function yu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _i=Hs(/[A-Za-z]/),br=Hs(/[\dA-Za-z]/),Tke=Hs(/[#-'*+\--9=?A-Z^-~]/);function mk(e){return e!==null&&(e<32||e===127)}const gk=Hs(/\d/),_ke=Hs(/[\dA-Fa-f]/),Mke=Hs(/[!-/:-@[-`{-~]/);function ge(e){return e!==null&&e<-2}function Zn(e){return e!==null&&(e<0||e===32)}function Ne(e){return e===-2||e===-1||e===32}const Ike=Hs(/\p{P}|\p{S}/u),jke=Hs(/\s/);function Hs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $c(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&br(e.charCodeAt(n+1))&&br(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function it(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ne(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ne(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const Rke={tokenize:Nke};function Nke(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),it(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ge(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const Dke={tokenize:Lke},yj={tokenize:$ke};function Lke(e){const t=this,n=[];let r=0,i,o,s;return a;function a(x){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,u)(x)}return u(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const k=t.events.length;let w=k,S;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){S=t.events[w][1].end;break}g(r);let O=k;for(;O<t.events.length;)t.events[O][1].end={...S},O++;return Gi(t.events,w+1,0,t.events.slice(k)),t.events.length=O,u(x)}return a(x)}function u(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(yj,c,f)(x)}function c(x){return i&&v(),g(r),h(x)}function f(x){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(yj,d,p)(x)}function d(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){i&&v(),g(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),m(x)}function m(x){if(x===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(x);return}return ge(x)?(e.consume(x),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),m)}function y(x,k){const w=t.sliceStream(x);if(k&&w.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(w),t.parser.lazy[x.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const O=t.events.length;let A=O,P,M;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(P){M=t.events[A][1].end;break}P=!0}for(g(r),S=O;S<t.events.length;)t.events[S][1].end={...M},S++;Gi(t.events,A+1,0,t.events.slice(O)),t.events.length=S}}function g(x){let k=n.length;for(;k-- >x;){const w=n[k];t.containerState=w[1],w[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function $ke(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vj(e){if(e===null||Zn(e)||jke(e))return 1;if(Ike(e))return 2}function YA(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const yk={name:"attention",resolveAll:Bke,tokenize:Fke};function Bke(e,t){let n=-1,r,i,o,s,a,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};bj(f,-l),bj(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Rr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Rr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Rr(u,YA(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Rr(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Rr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Gi(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Fke(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vj(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),c=vj(l),f=!c||c===2&&i||n.includes(l),h=!i||i===2&&c||n.includes(r);return u._open=!!(o===42?f:f&&(i||!h)),u._close=!!(o===42?h:h&&(c||!f)),t(l)}}function bj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const zke={name:"autolink",tokenize:Wke};function Wke(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return _i(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||br(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||br(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||mk(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),c):Tke(d)?(e.consume(d),u):n(d)}function c(d){return br(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||br(d))&&r++<63){const p=d===45?h:f;return e.consume(d),p}return n(d)}}const F0={partial:!0,tokenize:Uke};function Uke(e,t,n){return r;function r(o){return Ne(o)?it(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ge(o)?t(o):n(o)}}const f5={continuation:{tokenize:Vke},exit:qke,name:"blockQuote",tokenize:Hke};function Hke(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Ne(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Vke(e,t,n){const r=this;return i;function i(s){return Ne(s)?it(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(f5,t,n)(s)}}function qke(e){e.exit("blockQuote")}const h5={name:"characterEscape",tokenize:Kke};function Kke(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Mke(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const d5={name:"characterReference",tokenize:Gke};function Gke(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=br,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=_ke,c):(e.enter("characterReferenceValue"),o=7,s=gk,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===br&&!XA(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),c):n(f)}}const xj={partial:!0,tokenize:Xke},wj={concrete:!0,name:"codeFenced",tokenize:Qke};function Qke(e,t,n){const r=this,i={partial:!0,tokenize:w};let o=0,s=0,a;return l;function l(S){return u(S)}function u(S){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,e.consume(S),c):s<3?n(S):(e.exit("codeFencedFenceSequence"),Ne(S)?it(e,f,"whitespace")(S):f(S))}function f(S){return S===null||ge(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(xj,m,k)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||ge(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):Ne(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,d,"whitespace")(S)):S===96&&S===a?n(S):(e.consume(S),h)}function d(S){return S===null||ge(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||ge(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?n(S):(e.consume(S),p)}function m(S){return e.attempt(i,k,y)(S)}function y(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),g}function g(S){return o>0&&Ne(S)?it(e,v,"linePrefix",o+1)(S):v(S)}function v(S){return S===null||ge(S)?e.check(xj,m,k)(S):(e.enter("codeFlowValue"),x(S))}function x(S){return S===null||ge(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),x)}function k(S){return e.exit("codeFenced"),t(S)}function w(S,O,A){let P=0;return M;function M(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),_}function _(j){return S.enter("codeFencedFence"),Ne(j)?it(S,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):E(j)}function E(j){return j===a?(S.enter("codeFencedFenceSequence"),R(j)):A(j)}function R(j){return j===a?(P++,S.consume(j),R):P>=s?(S.exit("codeFencedFenceSequence"),Ne(j)?it(S,N,"whitespace")(j):N(j)):A(j)}function N(j){return j===null||ge(j)?(S.exit("codeFencedFence"),O(j)):A(j)}}}function Xke(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Ix={name:"codeIndented",tokenize:Zke},Yke={partial:!0,tokenize:Jke};function Zke(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),it(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ge(u)?e.attempt(Yke,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ge(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function Jke(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):it(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ge(s)?i(s):n(s)}}const eOe={name:"codeText",previous:nOe,resolve:tOe,tokenize:rOe};function tOe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function nOe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rOe(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,c(f)):ge(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ge(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",u(f))}}class iOe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&gf(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),gf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),gf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);gf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);gf(this.left,n.reverse())}}}function gf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function p5(e){const t={};let n=-1,r,i,o,s,a,l,u;const c=new iOe(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,oOe(c,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return Gi(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function oOe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let c,f,h=-1,d=n,p=0,m=0;const y=[m];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,y.push(m),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),h=y.length;h--;){const g=a.slice(y[h],y[h+1]),v=o.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),h=-1;++h<l.length;)u[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return u}const sOe={resolve:lOe,tokenize:uOe},aOe={partial:!0,tokenize:cOe};function lOe(e){return p5(e),e}function uOe(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):ge(a)?e.check(aOe,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function cOe(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,o,"linePrefix")}function o(s){if(s===null||ge(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function m5(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),h):g===null||g===32||g===41||mk(g)?n(g):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function h(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===62?(e.exit("chunkString"),e.exit(a),h(g)):g===null||g===60||ge(g)?n(g):(e.consume(g),g===92?p:d)}function p(g){return g===60||g===62||g===92?(e.consume(g),d):d(g)}function m(g){return!c&&(g===null||g===41||Zn(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):c<u&&g===40?(e.consume(g),c++,m):g===41?(e.consume(g),c--,m):g===null||g===32||g===40||mk(g)?n(g):(e.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function g5(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ge(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ge(d)||a++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!Ne(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function y5(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ge(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),it(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===s||h===null||ge(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:c)}function f(h){return h===s||h===92?(e.consume(h),c):c(h)}}function Jf(e,t){let n;return r;function r(i){return ge(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ne(i)?it(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const fOe={name:"definition",tokenize:dOe},hOe={partial:!0,tokenize:pOe};function dOe(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return g5.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=yu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return Zn(d)?Jf(e,u)(d):u(d)}function u(d){return m5(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(hOe,f,f)(d)}function f(d){return Ne(d)?it(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ge(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function pOe(e,t,n){return r;function r(a){return Zn(a)?Jf(e,i)(a):n(a)}function i(a){return y5(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ne(a)?it(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ge(a)?t(a):n(a)}}const mOe={name:"hardBreakEscape",tokenize:gOe};function gOe(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ge(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const yOe={name:"headingAtx",resolve:vOe,tokenize:bOe};function vOe(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function bOe(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||Zn(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ge(c)?(e.exit("atxHeading"),t(c)):Ne(c)?it(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Zn(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const xOe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Sj=["pre","script","style","textarea"],wOe={concrete:!0,name:"htmlFlow",resolveTo:OOe,tokenize:COe},SOe={partial:!0,tokenize:POe},kOe={partial:!0,tokenize:AOe};function OOe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function COe(e,t,n){const r=this;let i,o,s,a,l;return u;function u(I){return c(I)}function c(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),o=!0,m):I===63?(e.consume(I),i=3,r.interrupt?t:T):_i(I)?(e.consume(I),s=String.fromCharCode(I),y):n(I)}function h(I){return I===45?(e.consume(I),i=2,d):I===91?(e.consume(I),i=5,a=0,p):_i(I)?(e.consume(I),i=4,r.interrupt?t:T):n(I)}function d(I){return I===45?(e.consume(I),r.interrupt?t:T):n(I)}function p(I){const Y="CDATA[";return I===Y.charCodeAt(a++)?(e.consume(I),a===Y.length?r.interrupt?t:E:p):n(I)}function m(I){return _i(I)?(e.consume(I),s=String.fromCharCode(I),y):n(I)}function y(I){if(I===null||I===47||I===62||Zn(I)){const Y=I===47,G=s.toLowerCase();return!Y&&!o&&Sj.includes(G)?(i=1,r.interrupt?t(I):E(I)):xOe.includes(s.toLowerCase())?(i=6,Y?(e.consume(I),g):r.interrupt?t(I):E(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?v(I):x(I))}return I===45||br(I)?(e.consume(I),s+=String.fromCharCode(I),y):n(I)}function g(I){return I===62?(e.consume(I),r.interrupt?t:E):n(I)}function v(I){return Ne(I)?(e.consume(I),v):M(I)}function x(I){return I===47?(e.consume(I),M):I===58||I===95||_i(I)?(e.consume(I),k):Ne(I)?(e.consume(I),x):M(I)}function k(I){return I===45||I===46||I===58||I===95||br(I)?(e.consume(I),k):w(I)}function w(I){return I===61?(e.consume(I),S):Ne(I)?(e.consume(I),w):x(I)}function S(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,O):Ne(I)?(e.consume(I),S):A(I)}function O(I){return I===l?(e.consume(I),l=null,P):I===null||ge(I)?n(I):(e.consume(I),O)}function A(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Zn(I)?w(I):(e.consume(I),A)}function P(I){return I===47||I===62||Ne(I)?x(I):n(I)}function M(I){return I===62?(e.consume(I),_):n(I)}function _(I){return I===null||ge(I)?E(I):Ne(I)?(e.consume(I),_):n(I)}function E(I){return I===45&&i===2?(e.consume(I),B):I===60&&i===1?(e.consume(I),F):I===62&&i===4?(e.consume(I),q):I===63&&i===3?(e.consume(I),T):I===93&&i===5?(e.consume(I),z):ge(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(SOe,D,R)(I)):I===null||ge(I)?(e.exit("htmlFlowData"),R(I)):(e.consume(I),E)}function R(I){return e.check(kOe,N,D)(I)}function N(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),j}function j(I){return I===null||ge(I)?R(I):(e.enter("htmlFlowData"),E(I))}function B(I){return I===45?(e.consume(I),T):E(I)}function F(I){return I===47?(e.consume(I),s="",$):E(I)}function $(I){if(I===62){const Y=s.toLowerCase();return Sj.includes(Y)?(e.consume(I),q):E(I)}return _i(I)&&s.length<8?(e.consume(I),s+=String.fromCharCode(I),$):E(I)}function z(I){return I===93?(e.consume(I),T):E(I)}function T(I){return I===62?(e.consume(I),q):I===45&&i===2?(e.consume(I),T):E(I)}function q(I){return I===null||ge(I)?(e.exit("htmlFlowData"),D(I)):(e.consume(I),q)}function D(I){return e.exit("htmlFlow"),t(I)}}function AOe(e,t,n){const r=this;return i;function i(s){return ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function POe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(F0,t,n)}}const EOe={name:"htmlText",tokenize:TOe};function TOe(e,t,n){const r=this;let i,o,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),w):T===63?(e.consume(T),x):_i(T)?(e.consume(T),A):n(T)}function u(T){return T===45?(e.consume(T),c):T===91?(e.consume(T),o=0,p):_i(T)?(e.consume(T),v):n(T)}function c(T){return T===45?(e.consume(T),d):n(T)}function f(T){return T===null?n(T):T===45?(e.consume(T),h):ge(T)?(s=f,F(T)):(e.consume(T),f)}function h(T){return T===45?(e.consume(T),d):f(T)}function d(T){return T===62?B(T):T===45?h(T):f(T)}function p(T){const q="CDATA[";return T===q.charCodeAt(o++)?(e.consume(T),o===q.length?m:p):n(T)}function m(T){return T===null?n(T):T===93?(e.consume(T),y):ge(T)?(s=m,F(T)):(e.consume(T),m)}function y(T){return T===93?(e.consume(T),g):m(T)}function g(T){return T===62?B(T):T===93?(e.consume(T),g):m(T)}function v(T){return T===null||T===62?B(T):ge(T)?(s=v,F(T)):(e.consume(T),v)}function x(T){return T===null?n(T):T===63?(e.consume(T),k):ge(T)?(s=x,F(T)):(e.consume(T),x)}function k(T){return T===62?B(T):x(T)}function w(T){return _i(T)?(e.consume(T),S):n(T)}function S(T){return T===45||br(T)?(e.consume(T),S):O(T)}function O(T){return ge(T)?(s=O,F(T)):Ne(T)?(e.consume(T),O):B(T)}function A(T){return T===45||br(T)?(e.consume(T),A):T===47||T===62||Zn(T)?P(T):n(T)}function P(T){return T===47?(e.consume(T),B):T===58||T===95||_i(T)?(e.consume(T),M):ge(T)?(s=P,F(T)):Ne(T)?(e.consume(T),P):B(T)}function M(T){return T===45||T===46||T===58||T===95||br(T)?(e.consume(T),M):_(T)}function _(T){return T===61?(e.consume(T),E):ge(T)?(s=_,F(T)):Ne(T)?(e.consume(T),_):P(T)}function E(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,R):ge(T)?(s=E,F(T)):Ne(T)?(e.consume(T),E):(e.consume(T),N)}function R(T){return T===i?(e.consume(T),i=void 0,j):T===null?n(T):ge(T)?(s=R,F(T)):(e.consume(T),R)}function N(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Zn(T)?P(T):(e.consume(T),N)}function j(T){return T===47||T===62||Zn(T)?P(T):n(T)}function B(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function F(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),$}function $(T){return Ne(T)?it(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):z(T)}function z(T){return e.enter("htmlTextData"),s(T)}}const ZA={name:"labelEnd",resolveAll:jOe,resolveTo:ROe,tokenize:NOe},_Oe={tokenize:DOe},MOe={tokenize:LOe},IOe={tokenize:$Oe};function jOe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Gi(e,0,e.length,n),e}function ROe(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Rr(a,e.slice(o+1,o+r+3)),a=Rr(a,[["enter",c,t]]),a=Rr(a,YA(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Rr(a,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),a=Rr(a,e.slice(s+1)),a=Rr(a,[["exit",l,t]]),Gi(e,o,e.length,a),e}function NOe(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?f(h):(s=r.parser.defined.includes(yu(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(_Oe,c,s?c:f)(h):h===91?e.attempt(MOe,c,s?u:f)(h):s?c(h):f(h)}function u(h){return e.attempt(IOe,c,f)(h)}function c(h){return t(h)}function f(h){return o._balanced=!0,n(h)}}function DOe(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Zn(f)?Jf(e,o)(f):o(f)}function o(f){return f===41?c(f):m5(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Zn(f)?Jf(e,l)(f):c(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?y5(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return Zn(f)?Jf(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function LOe(e,t,n){const r=this;return i;function i(a){return g5.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(yu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function $Oe(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const BOe={name:"labelStartImage",resolveAll:ZA.resolveAll,tokenize:FOe};function FOe(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const zOe={name:"labelStartLink",resolveAll:ZA.resolveAll,tokenize:WOe};function WOe(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const jx={name:"lineEnding",tokenize:UOe};function UOe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),it(e,t,"linePrefix")}}const Um={name:"thematicBreak",tokenize:HOe};function HOe(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ge(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Ne(u)?it(e,a,"whitespace")(u):a(u))}}const $n={continuation:{tokenize:GOe},exit:XOe,name:"list",tokenize:KOe},VOe={partial:!0,tokenize:YOe},qOe={partial:!0,tokenize:QOe};function KOe(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:gk(d)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Um,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return gk(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(F0,r.interrupt?n:c,e.attempt(VOe,h,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function f(d){return Ne(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function GOe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(F0,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,it(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ne(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qOe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,it(e,e.attempt($n,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function QOe(e,t,n){const r=this;return it(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function XOe(e){e.exit(this.containerState.type)}function YOe(e,t,n){const r=this;return it(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ne(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const kj={name:"setextUnderline",resolveTo:ZOe,tokenize:JOe};function ZOe(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function JOe(e,t,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Ne(u)?it(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ge(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const eCe={tokenize:tCe};function tCe(e){const t=this,n=e.attempt(F0,r,e.attempt(this.parser.constructs.flowInitial,i,it(e,e.attempt(this.parser.constructs.flow,i,e.attempt(sOe,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const nCe={resolveAll:b5()},rCe=v5("string"),iCe=v5("text");function v5(e){return{resolveAll:b5(e==="text"?oCe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function b5(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function oCe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const sCe={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:f5},aCe={91:fOe},lCe={[-2]:Ix,[-1]:Ix,32:Ix},uCe={35:yOe,42:Um,45:[kj,Um],60:wOe,61:kj,95:Um,96:wj,126:wj},cCe={38:d5,92:h5},fCe={[-5]:jx,[-4]:jx,[-3]:jx,33:BOe,38:d5,42:yk,60:[zke,EOe],91:zOe,92:[mOe,h5],93:ZA,95:yk,96:eOe},hCe={null:[yk,nCe]},dCe={null:[42,95]},pCe={null:[]},mCe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dCe,contentInitial:aCe,disable:pCe,document:sCe,flow:uCe,flowInitial:lCe,insideSpan:hCe,string:cCe,text:fCe},Symbol.toStringTag,{value:"Module"}));function gCe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:O(w),check:O(S),consume:v,enter:x,exit:k,interrupt:O(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:f};let c=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function f(_){return s=Rr(s,_),y(),s[s.length-1]!==null?[]:(A(t,0),u.events=YA(o,u.events,u),u.events)}function h(_,E){return vCe(d(_),E)}function d(_){return yCe(s,_)}function p(){const{_bufferIndex:_,_index:E,line:R,column:N,offset:j}=r;return{_bufferIndex:_,_index:E,line:R,column:N,offset:j}}function m(_){i[_.line]=_.column,M()}function y(){let _;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<E.length;)g(E.charCodeAt(r._bufferIndex));else g(E)}}function g(_){c=c(_)}function v(_){ge(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,M()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=_}function x(_,E){const R=E||{};return R.type=_,R.start=p(),u.events.push(["enter",R,u]),a.push(R),R}function k(_){const E=a.pop();return E.end=p(),u.events.push(["exit",E,u]),E}function w(_,E){A(_,E.from)}function S(_,E){E.restore()}function O(_,E){return R;function R(N,j,B){let F,$,z,T;return Array.isArray(N)?D(N):"tokenize"in N?D([N]):q(N);function q(te){return fe;function fe(ye){const Q=ye!==null&&te[ye],ue=ye!==null&&te.null,me=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return D(me)(ye)}}function D(te){return F=te,$=0,te.length===0?B:I(te[$])}function I(te){return fe;function fe(ye){return T=P(),z=te,te.partial||(u.currentConstruct=te),te.name&&u.parser.constructs.disable.null.includes(te.name)?G():te.tokenize.call(E?Object.assign(Object.create(u),E):u,l,Y,G)(ye)}}function Y(te){return _(z,T),j}function G(te){return T.restore(),++$<F.length?I(F[$]):B}}}function A(_,E){_.resolveAll&&!o.includes(_)&&o.push(_),_.resolve&&Gi(u.events,E,u.events.length-E,_.resolve(u.events.slice(E),u)),_.resolveTo&&(u.events=_.resolveTo(u.events,u))}function P(){const _=p(),E=u.previous,R=u.currentConstruct,N=u.events.length,j=Array.from(a);return{from:N,restore:B};function B(){r=_,u.previous=E,u.currentConstruct=R,u.events.length=N,a=j,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function yCe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function vCe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
339
+ `;break}case-3:{s=`\r
340
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function bCe(e){const r={constructs:Ake([mCe,...(e||{}).extensions||[]]),content:i(Rke),defined:[],document:i(Dke),flow:i(eCe),lazy:{},string:i(rCe),text:i(iCe)};return r;function i(o){return s;function s(a){return gCe(r,o,a)}}}function xCe(e){for(;!p5(e););return e}const Oj=/[\0\t\n\r]/g;function wCe(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,c,f,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(Oj.lastIndex=f,u=Oj.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(f);break}if(d===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(o.slice(f,h)),e+=h-f),d){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const SCe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kCe(e){return e.replace(SCe,OCe)}function OCe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return c5(n.slice(o?2:1),o?16:10)}return XA(n)||e}const x5={}.hasOwnProperty;function CCe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ACe(n)(xCe(bCe(n).document().write(wCe()(e,t,!0))))}function ACe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ir),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(ht),blockQuote:o(ue),characterEscape:P,characterReference:P,codeFenced:o(me),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(me,s),codeText:o(X,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(qe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ce),hardBreakEscape:o(st),hardBreakTrailing:o(st),htmlFlow:o(_t,s),htmlFlowData:P,htmlText:o(_t,s),htmlTextData:P,image:o(tn),label:s,link:o(ir),listItem:o(Yr),listItemValue:h,listOrdered:o(Cn,f),listUnordered:o(Cn),paragraph:o(Er),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ht),strong:o(qs),thematicBreak:o($e)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:Q,autolinkProtocol:ye,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:te,characterReference:fe,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:M,codeIndented:l(g),codeText:l(j),codeTextData:M,data:M,definition:l(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(R),htmlFlowData:M,htmlText:l(N),htmlTextData:M,image:l(F),label:z,labelText:$,lineEnding:_,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Y,resourceDestinationString:T,resourceTitleString:q,resource:D,setextHeading:l(A),setextHeadingLineSequence:O,setextHeadingText:S,strong:l(),thematicBreak:l()}};w5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let ee={type:"root",children:[]};const ve={stack:[ee],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:c,data:n},Te=[];let Ke=-1;for(;++Ke<U.length;)if(U[Ke][1].type==="listOrdered"||U[Ke][1].type==="listUnordered")if(U[Ke][0]==="enter")Te.push(Ke);else{const Zr=Te.pop();Ke=i(U,Zr,Ke)}for(Ke=-1;++Ke<U.length;){const Zr=t[U[Ke][0]];x5.call(Zr,U[Ke][1].type)&&Zr[U[Ke][1].type].call(Object.assign({sliceSerialize:U[Ke][2].sliceSerialize},ve),U[Ke][1])}if(ve.tokenStack.length>0){const Zr=ve.tokenStack[ve.tokenStack.length-1];(Zr[1]||Cj).call(ve,void 0,Zr[0])}for(ee.position={start:Wo(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Wo(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)ee=t.transforms[Ke](ee)||ee;return ee}function i(U,ee,ve){let Te=ee-1,Ke=-1,Zr=!1,Gs,eo,Wc,Uc;for(;++Te<=ve;){const or=U[Te];switch(or[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{or[0]==="enter"?Ke++:Ke--,Uc=void 0;break}case"lineEndingBlank":{or[0]==="enter"&&(Gs&&!Uc&&!Ke&&!Wc&&(Wc=Te),Uc=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Uc=void 0}if(!Ke&&or[0]==="enter"&&or[1].type==="listItemPrefix"||Ke===-1&&or[0]==="exit"&&(or[1].type==="listUnordered"||or[1].type==="listOrdered")){if(Gs){let ml=Te;for(eo=void 0;ml--;){const to=U[ml];if(to[1].type==="lineEnding"||to[1].type==="lineEndingBlank"){if(to[0]==="exit")continue;eo&&(U[eo][1].type="lineEndingBlank",Zr=!0),to[1].type="lineEnding",eo=ml}else if(!(to[1].type==="linePrefix"||to[1].type==="blockQuotePrefix"||to[1].type==="blockQuotePrefixWhitespace"||to[1].type==="blockQuoteMarker"||to[1].type==="listItemIndent"))break}Wc&&(!eo||Wc<eo)&&(Gs._spread=!0),Gs.end=Object.assign({},eo?U[eo][1].start:or[1].end),U.splice(eo||Te,0,["exit",Gs,or[2]]),Te++,ve++}if(or[1].type==="listItemPrefix"){const ml={type:"listItem",_spread:!1,start:Object.assign({},or[1].start),end:void 0};Gs=ml,U.splice(Te,0,["enter",ml,or[2]]),Te++,ve++,Wc=void 0,Uc=!0}}}return U[ee][1]._spread=Zr,ve}function o(U,ee){return ve;function ve(Te){a.call(this,U(Te),Te),ee&&ee.call(this,Te)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(U,ee,ve){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([ee,ve||void 0]),U.position={start:Wo(ee.start),end:void 0}}function l(U){return ee;function ee(ve){U&&U.call(this,ve),u.call(this,ve)}}function u(U,ee){const ve=this.stack.pop(),Te=this.tokenStack.pop();if(Te)Te[0].type!==U.type&&(ee?ee.call(this,U,Te[0]):(Te[1]||Cj).call(this,U,Te[0]));else throw new Error("Cannot close `"+U.type+"` ("+Zf({start:U.start,end:U.end})+"): it’s not open");ve.position.end=Wo(U.end)}function c(){return Oke(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function d(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=U}function p(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=U}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U.replace(/(\r?\n|\r)$/g,"")}function v(U){const ee=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ee,ve.identifier=yu(this.sliceSerialize(U)).toLowerCase()}function x(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.title=U}function k(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.url=U}function w(U){const ee=this.stack[this.stack.length-1];if(!ee.depth){const ve=this.sliceSerialize(U).length;ee.depth=ve}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function O(U){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const ve=this.stack[this.stack.length-1].children;let Te=ve[ve.length-1];(!Te||Te.type!=="text")&&(Te=Ks(),Te.position={start:Wo(U.start),end:void 0},ve.push(Te)),this.stack.push(Te)}function M(U){const ee=this.stack.pop();ee.value+=this.sliceSerialize(U),ee.position.end=Wo(U.end)}function _(U){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=ee.children[ee.children.length-1];ve.position.end=Wo(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(P.call(this,U),M.call(this,U))}function E(){this.data.atHardBreak=!0}function R(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U}function N(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U}function j(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.value=U}function B(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ee,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function F(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=ee,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function $(U){const ee=this.sliceSerialize(U),ve=this.stack[this.stack.length-2];ve.label=kCe(ee),ve.identifier=yu(ee).toLowerCase()}function z(){const U=this.stack[this.stack.length-1],ee=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Te=U.children;ve.children=Te}else ve.alt=ee}function T(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.url=U}function q(){const U=this.resume(),ee=this.stack[this.stack.length-1];ee.title=U}function D(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Y(U){const ee=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ee,ve.identifier=yu(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function G(U){this.data.characterReferenceType=U.type}function te(U){const ee=this.sliceSerialize(U),ve=this.data.characterReferenceType;let Te;ve?(Te=c5(ee,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Te=XA(ee);const Ke=this.stack[this.stack.length-1];Ke.value+=Te}function fe(U){const ee=this.stack.pop();ee.position.end=Wo(U.end)}function ye(U){M.call(this,U);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(U)}function Q(U){M.call(this,U);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(U)}function ue(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function qe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function ht(){return{type:"heading",depth:0,children:[]}}function st(){return{type:"break"}}function _t(){return{type:"html",value:""}}function tn(){return{type:"image",title:null,url:"",alt:null}}function ir(){return{type:"link",title:null,url:"",children:[]}}function Cn(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Yr(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Er(){return{type:"paragraph",children:[]}}function qs(){return{type:"strong",children:[]}}function Ks(){return{type:"text",value:""}}function $e(){return{type:"thematicBreak"}}}function Wo(e){return{line:e.line,column:e.column,offset:e.offset}}function w5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?w5(e,r):PCe(e,r)}}function PCe(e,t){let n;for(n in t)if(x5.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Cj(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Zf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Zf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Zf({start:t.start,end:t.end})+") is still open")}function ECe(e){const t=this;t.parser=n;function n(r){return CCe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function TCe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function _Ce(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
341
+ `}]}function MCe(e,t){const n=t.value?t.value+`
342
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function ICe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jCe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RCe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=$c(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function NCe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DCe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function S5(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function LCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return S5(e,t);const i={src:$c(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function $Ce(e,t){const n={src:$c(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function BCe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function FCe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return S5(e,t);const i={href:$c(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function zCe(e,t){const n={href:$c(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function WCe(e,t,n){const r=e.all(t),i=n?UCe(n):k5(t),o={},s=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
343
+ `}),c.type==="element"&&c.tagName==="p"&&!i?s.push(...c.children):s.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
344
+ `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function UCe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=k5(n[r])}return t}function k5(e){const t=e.spread;return t??e.children.length>1}function HCe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function VCe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qCe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function KCe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GCe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=qA(t.children[1]),l=r5(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function QCe(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const f=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let p={type:"element",tagName:o,properties:h,children:[]};f&&(p.children=e.all(f),e.patch(f,p),p=e.applyData(f,p)),u.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function XCe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Aj=9,Pj=32;function YCe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Ej(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Ej(t.slice(i),i>0,!1)),o.join("")}function Ej(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Aj||o===Pj;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Aj||o===Pj;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ZCe(e,t){const n={type:"text",value:YCe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JCe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const eAe={blockquote:TCe,break:_Ce,code:MCe,delete:ICe,emphasis:jCe,footnoteReference:RCe,heading:NCe,html:DCe,imageReference:LCe,image:$Ce,inlineCode:BCe,linkReference:FCe,link:zCe,listItem:WCe,list:HCe,paragraph:VCe,root:qCe,strong:KCe,table:GCe,tableCell:XCe,tableRow:QCe,text:ZCe,thematicBreak:JCe,toml:Xp,yaml:Xp,definition:Xp,footnoteDefinition:Xp};function Xp(){}const O5=-1,z0=0,eh=1,Ly=2,JA=3,eP=4,tP=5,nP=6,C5=7,A5=8,Tj=typeof self=="object"?self:globalThis,tAe=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case z0:case O5:return n(s,i);case eh:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Ly:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case JA:return n(new Date(s),i);case eP:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case tP:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case nP:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case C5:{const{name:a,message:l}=s;return n(new Tj[a](l),i)}case A5:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new Tj[o](s),i)};return r},_j=e=>tAe(new Map,e)(0),Ol="",{toString:nAe}={},{keys:rAe}=Object,yf=e=>{const t=typeof e;if(t!=="object"||!e)return[z0,t];const n=nAe.call(e).slice(8,-1);switch(n){case"Array":return[eh,Ol];case"Object":return[Ly,Ol];case"Date":return[JA,Ol];case"RegExp":return[eP,Ol];case"Map":return[tP,Ol];case"Set":return[nP,Ol];case"DataView":return[eh,n]}return n.includes("Array")?[eh,n]:n.includes("Error")?[C5,n]:[Ly,n]},Yp=([e,t])=>e===z0&&(t==="function"||t==="symbol"),iAe=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=yf(s);switch(a){case z0:{let c=s;switch(l){case"bigint":a=A5,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([O5],s)}return i([a,c],s)}case eh:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const c=[],f=i([a,c],s);for(const h of s)c.push(o(h));return f}case Ly:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const h of rAe(s))(e||!Yp(yf(s[h])))&&c.push([o(h),o(s[h])]);return f}case JA:return i([a,s.toISOString()],s);case eP:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case tP:{const c=[],f=i([a,c],s);for(const[h,d]of s)(e||!(Yp(yf(h))||Yp(yf(d))))&&c.push([o(h),o(d)]);return f}case nP:{const c=[],f=i([a,c],s);for(const h of s)(e||!Yp(yf(h)))&&c.push(o(h));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},Mj=(e,{json:t,lossy:n}={})=>{const r=[];return iAe(!(t||n),!!t,new Map,r)(e),r},$y=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_j(Mj(e,t)):structuredClone(e):(e,t)=>_j(Mj(e,t));function oAe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function sAe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aAe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||oAe,r=e.options.footnoteBackLabel||sAe,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),f=String(u.identifier).toUpperCase(),h=$c(f.toLowerCase());let d=0;const p=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++d<=m;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=c[c.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...p)}else c.push(...p);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$y(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
345
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
346
+ `}]}}const P5=function(e){if(e==null)return fAe;if(typeof e=="function")return W0(e);if(typeof e=="object")return Array.isArray(e)?lAe(e):uAe(e);if(typeof e=="string")return cAe(e);throw new Error("Expected function, string, or object as test")};function lAe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=P5(e[n]);return W0(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function uAe(e){const t=e;return W0(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function cAe(e){return W0(t);function t(n){return n&&n.type===e}}function W0(e){return t;function t(n,r,i){return!!(hAe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function fAe(){return!0}function hAe(e){return e!==null&&typeof e=="object"&&"type"in e}const E5=[],dAe=!0,Ij=!1,pAe="skip";function mAe(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=P5(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=E5,p,m,y;if((!t||o(l,u,c[c.length-1]||void 0))&&(d=gAe(n(l,c)),d[0]===Ij))return d;if("children"in l&&l.children){const g=l;if(g.children&&d[0]!==pAe)for(m=(r?g.children.length:-1)+s,y=c.concat(g);m>-1&&m<g.children.length;){const v=g.children[m];if(p=a(v,m,y)(),p[0]===Ij)return p;m=typeof p[1]=="number"?p[1]:m+s}}return d}}}function gAe(e){return Array.isArray(e)?e:typeof e=="number"?[dAe,e]:e==null?E5:[e]}function T5(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),mAe(e,o,a,i);function a(l,u){const c=u[u.length-1],f=c?c.children.indexOf(l):void 0;return s(l,f,c)}}const vk={}.hasOwnProperty,yAe={};function vAe(e,t){const n=t||yAe,r=new Map,i=new Map,o=new Map,s={...eAe,...n.handlers},a={all:u,applyData:xAe,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:bAe,wrap:SAe};return T5(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,h=String(c.identifier).toUpperCase();f.has(h)||f.set(h,c)}}),a;function l(c,f){const h=c.type,d=a.handlers[h];if(vk.call(a.handlers,h)&&d)return d(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in c){const{children:m,...y}=c,g=$y(y);return g.children=a.all(c),g}return $y(c)}return(a.options.unknownHandler||wAe)(a,c,f)}function u(c){const f=[];if("children"in c){const h=c.children;let d=-1;for(;++d<h.length;){const p=a.one(h[d],c);if(p){if(d&&h[d-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=jj(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=jj(m.value))}Array.isArray(p)?f.push(...p):f.push(p)}}}return f}}function bAe(e,t){e.position&&(t.position=nke(e))}function xAe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,$y(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function wAe(e,t){const n=t.data||{},r="value"in t&&!(vk.call(n,"hProperties")||vk.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SAe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
347
+ `});++r<e.length;)r&&n.push({type:"text",value:`
348
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
349
+ `}),n}function jj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Rj(e,t){const n=vAe(e,t),r=n.one(e,void 0),i=aAe(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
350
+ `},i),o}function kAe(e,t){return e&&"run"in e?async function(n,r){const i=Rj(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Rj(n,{file:r,...e||t})}}function Nj(e){if(e)throw e}var Hm=Object.prototype.hasOwnProperty,_5=Object.prototype.toString,Dj=Object.defineProperty,Lj=Object.getOwnPropertyDescriptor,$j=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_5.call(t)==="[object Array]"},Bj=function(t){if(!t||_5.call(t)!=="[object Object]")return!1;var n=Hm.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Hm.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Hm.call(t,i)},Fj=function(t,n){Dj&&n.name==="__proto__"?Dj(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},zj=function(t,n){if(n==="__proto__")if(Hm.call(t,n)){if(Lj)return Lj(t,n).value}else return;return t[n]},OAe=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=zj(a,n),i=zj(t,n),a!==i&&(c&&i&&(Bj(i)||(o=$j(i)))?(o?(o=!1,s=r&&$j(r)?r:[]):s=r&&Bj(r)?r:{},Fj(a,{name:n,newValue:e(c,s,i)})):typeof i<"u"&&Fj(a,{name:n,newValue:i}));return a};const Rx=De(OAe);function bk(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function CAe(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const c=e[++o];let f=-1;if(l){s(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?AAe(c,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function AAe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ai={basename:PAe,dirname:EAe,extname:TAe,join:_Ae,sep:"/"};function PAe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rp(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function EAe(e){if(rp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TAe(e){rp(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function _Ae(...e){let t=-1,n;for(;++t<e.length;)rp(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":MAe(n)}function MAe(e){rp(e);const t=e.codePointAt(0)===47;let n=IAe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function IAe(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function rp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const jAe={cwd:RAe};function RAe(){return"/"}function xk(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NAe(e){if(typeof e=="string")e=new URL(e);else if(!xk(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return DAe(e)}function DAe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Nx=["history","path","basename","stem","extname","dirname"];class M5{constructor(t){let n;t?xk(t)?n={path:t}:typeof t=="string"||LAe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":jAe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Nx.length;){const o=Nx[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Nx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(t){Lx(t,"basename"),Dx(t,"basename"),this.path=Ai.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(t){Wj(this.basename,"dirname"),this.path=Ai.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(t){if(Dx(t,"extname"),Wj(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ai.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){xk(t)&&(t=NAe(t)),Lx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(t){Lx(t,"stem"),Dx(t,"stem"),this.path=Ai.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new wn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Dx(e,t){if(e&&e.includes(Ai.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ai.sep+"`")}function Lx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wj(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function LAe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $Ae=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},BAe={}.hasOwnProperty;class rP extends $Ae{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=CAe()}copy(){const t=new rP;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Rx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fx("data",this.frozen),this.namespace[t]=n,this):BAe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zp(t),r=this.parser||this.Parser;return $x("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$x("process",this.parser||this.Parser),Bx("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Zp(t),l=r.parse(a);r.run(l,a,function(c,f,h){if(c||!f||!h)return u(c);const d=f,p=r.stringify(d,h);WAe(p)?h.value=p:h.result=p,u(c,h)});function u(c,f){c||!f?s(c):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),$x("processSync",this.parser||this.Parser),Bx("processSync",this.compiler||this.Compiler),this.process(t,i),Hj("processSync","process",n),r;function i(o,s){n=!0,Nj(o),r=s}}run(t,n,r){Uj(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Zp(n);i.run(t,l,u);function u(c,f,h){const d=f||t;c?a(c):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Hj("runSync","run",r),i;function o(s,a){Nj(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Zp(n),i=this.compiler||this.Compiler;return Bx("stringify",i),Uj(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Fx("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=Rx(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[d,...p]=c;const m=r[h][1];bk(m)&&bk(d)&&(d=Rx(!0,m,d)),r[h]=[u,d,...p]}}}}const FAe=new rP().freeze();function $x(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fx(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Uj(e){if(!bk(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hj(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zp(e){return zAe(e)?e:new M5(e)}function zAe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function WAe(e){return typeof e=="string"||UAe(e)}function UAe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const HAe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vj=[],qj={allowDangerousHtml:!0},VAe=/^(https?|ircs?|mailto|xmpp)$/i,qAe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function KAe(e){const t=GAe(e),n=QAe(e);return XAe(t.runSync(t.parse(n),n),e)}function GAe(e){const t=e.rehypePlugins||Vj,n=e.remarkPlugins||Vj,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qj}:qj;return FAe().use(ECe).use(n).use(kAe,r).use(t)}function QAe(e){const t=e.children||"",n=new M5;return typeof t=="string"&&(n.value=t),n}function XAe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||YAe;for(const c of qAe)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+HAe+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),T5(e,u),ake(e,{Fragment:b.Fragment,components:i,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function u(c,f,h){if(c.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let d;for(d in Mx)if(Object.hasOwn(Mx,d)&&Object.hasOwn(c.properties,d)){const p=c.properties[d],m=Mx[d];(m===null||m.includes(c.tagName))&&(c.properties[d]=l(String(p||""),d,c))}}if(c.type==="element"){let d=n?!n.includes(c.tagName):o?o.includes(c.tagName):!1;if(!d&&r&&typeof f=="number"&&(d=!r(c,f,h)),d&&h&&typeof f=="number")return a&&c.children?h.children.splice(f,1,...c.children):h.children.splice(f,1),f}}}function YAe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||VAe.test(e.slice(0,t))?e:""}var ZAe=Object.create,U0=Object.defineProperty,JAe=Object.defineProperties,ePe=Object.getOwnPropertyDescriptor,tPe=Object.getOwnPropertyDescriptors,I5=Object.getOwnPropertyNames,By=Object.getOwnPropertySymbols,nPe=Object.getPrototypeOf,iP=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,Kj=(e,t,n)=>t in e?U0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ui=(e,t)=>{for(var n in t||(t={}))iP.call(t,n)&&Kj(e,n,t[n]);if(By)for(var n of By(t))j5.call(t,n)&&Kj(e,n,t[n]);return e},H0=(e,t)=>JAe(e,tPe(t)),R5=(e,t)=>{var n={};for(var r in e)iP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&By)for(var r of By(e))t.indexOf(r)<0&&j5.call(e,r)&&(n[r]=e[r]);return n},rPe=(e,t)=>function(){return t||(0,e[I5(e)[0]])((t={exports:{}}).exports,t),t.exports},iPe=(e,t)=>{for(var n in t)U0(e,n,{get:t[n],enumerable:!0})},oPe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of I5(t))!iP.call(e,i)&&i!==n&&U0(e,i,{get:()=>t[i],enumerable:!(r=ePe(t,i))||r.enumerable});return e},sPe=(e,t,n)=>(n=e!=null?ZAe(nPe(e)):{},oPe(!e||!e.__esModule?U0(n,"default",{value:e,enumerable:!0}):n,e)),aPe=rPe({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},s={util:{encode:function p(m){return m instanceof a?new a(m.type,p(m.content),m.alias):Array.isArray(m)?m.map(p):m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++i}),p.__id},clone:function p(m,y){y=y||{};var g,v;switch(s.util.type(m)){case"Object":if(v=s.util.objId(m),y[v])return y[v];g={},y[v]=g;for(var x in m)m.hasOwnProperty(x)&&(g[x]=p(m[x],y));return g;case"Array":return v=s.util.objId(m),y[v]?y[v]:(g=[],y[v]=g,m.forEach(function(k,w){g[w]=p(k,y)}),g);default:return m}},getLanguage:function(p){for(;p;){var m=r.exec(p.className);if(m)return m[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,m){p.className=p.className.replace(RegExp(r,"gi"),""),p.classList.add("language-"+m)},isActive:function(p,m,y){for(var g="no-"+m;p;){var v=p.classList;if(v.contains(m))return!0;if(v.contains(g))return!1;p=p.parentElement}return!!y}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(p,m){var y=s.util.clone(s.languages[p]);for(var g in m)y[g]=m[g];return y},insertBefore:function(p,m,y,g){g=g||s.languages;var v=g[p],x={};for(var k in v)if(v.hasOwnProperty(k)){if(k==m)for(var w in y)y.hasOwnProperty(w)&&(x[w]=y[w]);y.hasOwnProperty(k)||(x[k]=v[k])}var S=g[p];return g[p]=x,s.languages.DFS(s.languages,function(O,A){A===S&&O!=p&&(this[O]=x)}),x},DFS:function p(m,y,g,v){v=v||{};var x=s.util.objId;for(var k in m)if(m.hasOwnProperty(k)){y.call(m,k,m[k],g||k);var w=m[k],S=s.util.type(w);S==="Object"&&!v[x(w)]?(v[x(w)]=!0,p(w,y,null,v)):S==="Array"&&!v[x(w)]&&(v[x(w)]=!0,p(w,y,k,v))}}},plugins:{},highlight:function(p,m,y){var g={code:p,grammar:m,language:y};if(s.hooks.run("before-tokenize",g),!g.grammar)throw new Error('The language "'+g.language+'" has no grammar.');return g.tokens=s.tokenize(g.code,g.grammar),s.hooks.run("after-tokenize",g),a.stringify(s.util.encode(g.tokens),g.language)},tokenize:function(p,m){var y=m.rest;if(y){for(var g in y)m[g]=y[g];delete m.rest}var v=new c;return f(v,v.head,p),u(p,v,m,v.head,0),d(v)},hooks:{all:{},add:function(p,m){var y=s.hooks.all;y[p]=y[p]||[],y[p].push(m)},run:function(p,m){var y=s.hooks.all[p];if(!(!y||!y.length))for(var g=0,v;v=y[g++];)v(m)}},Token:a};function a(p,m,y,g){this.type=p,this.content=m,this.alias=y,this.length=(g||"").length|0}a.stringify=function p(m,y){if(typeof m=="string")return m;if(Array.isArray(m)){var g="";return m.forEach(function(S){g+=p(S,y)}),g}var v={type:m.type,content:p(m.content,y),tag:"span",classes:["token",m.type],attributes:{},language:y},x=m.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(v.classes,x):v.classes.push(x)),s.hooks.run("wrap",v);var k="";for(var w in v.attributes)k+=" "+w+'="'+(v.attributes[w]||"").replace(/"/g,"&quot;")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+k+">"+v.content+"</"+v.tag+">"};function l(p,m,y,g){p.lastIndex=m;var v=p.exec(y);if(v&&g&&v[1]){var x=v[1].length;v.index+=x,v[0]=v[0].slice(x)}return v}function u(p,m,y,g,v,x){for(var k in y)if(!(!y.hasOwnProperty(k)||!y[k])){var w=y[k];w=Array.isArray(w)?w:[w];for(var S=0;S<w.length;++S){if(x&&x.cause==k+","+S)return;var O=w[S],A=O.inside,P=!!O.lookbehind,M=!!O.greedy,_=O.alias;if(M&&!O.pattern.global){var E=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,E+"g")}for(var R=O.pattern||O,N=g.next,j=v;N!==m.tail&&!(x&&j>=x.reach);j+=N.value.length,N=N.next){var B=N.value;if(m.length>p.length)return;if(!(B instanceof a)){var F=1,$;if(M){if($=l(R,j,p,P),!$||$.index>=p.length)break;var D=$.index,z=$.index+$[0].length,T=j;for(T+=N.value.length;D>=T;)N=N.next,T+=N.value.length;if(T-=N.value.length,j=T,N.value instanceof a)continue;for(var q=N;q!==m.tail&&(T<z||typeof q.value=="string");q=q.next)F++,T+=q.value.length;F--,B=p.slice(j,T),$.index-=j}else if($=l(R,0,B,P),!$)continue;var D=$.index,I=$[0],Y=B.slice(0,D),G=B.slice(D+I.length),te=j+B.length;x&&te>x.reach&&(x.reach=te);var fe=N.prev;Y&&(fe=f(m,fe,Y),j+=Y.length),h(m,fe,F);var ye=new a(k,A?s.tokenize(I,A):I,_,I);if(N=f(m,fe,ye),G&&f(m,N,G),F>1){var Q={cause:k+","+S,reach:te};u(p,m,y,N.prev,j,Q),x&&Q.reach>x.reach&&(x.reach=Q.reach)}}}}}}function c(){var p={value:null,prev:null,next:null},m={value:null,prev:p,next:null};p.next=m,this.head=p,this.tail=m,this.length=0}function f(p,m,y){var g=m.next,v={value:y,prev:m,next:g};return m.next=v,g.prev=v,p.length++,v}function h(p,m,y){for(var g=m.next,v=0;v<y&&g!==p.tail;v++)g=g.next;m.next=g,g.prev=m,p.length-=v}function d(p){for(var m=[],y=p.head.next;y!==p.tail;)m.push(y.value),y=y.next;return m}return s}();t.exports=n,n.default=n}}),K=sPe(aPe());K.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},K.languages.markup.tag.inside["attr-value"].inside.entity=K.languages.markup.entity,K.languages.markup.doctype.inside["internal-subset"].inside=K.languages.markup,K.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(K.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:K.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:K.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},K.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(K.languages.markup.tag,"addAttribute",{value:function(e,t){K.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:K.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),K.languages.html=K.languages.markup,K.languages.mathml=K.languages.markup,K.languages.svg=K.languages.markup,K.languages.xml=K.languages.extend("markup",{}),K.languages.ssml=K.languages.xml,K.languages.atom=K.languages.xml,K.languages.rss=K.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(K),K.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},K.languages.javascript=K.languages.extend("clike",{"class-name":[K.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),K.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,K.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:K.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:K.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:K.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:K.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:K.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),K.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:K.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),K.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),K.languages.markup&&(K.languages.markup.tag.addInlined("script","javascript"),K.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),K.languages.js=K.languages.javascript,K.languages.actionscript=K.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),K.languages.actionscript["class-name"].alias="function",delete K.languages.actionscript.parameter,delete K.languages.actionscript["literal-property"],K.languages.markup&&K.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:K.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(K),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var o=function(f){f.inside||(f.inside={}),f.inside.rest=r},s="doc-comment";if(a=e.languages[i]){var a,l=a[s];if((l=l||(a=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(l=a[s]={pattern:l}),Array.isArray(l))for(var u=0,c=l.length;u<c;u++)l[u]instanceof RegExp&&(l[u]={pattern:l[u]}),o(l[u]);else o(l)}})}}),t.addSupport(["java","javascript","php"],t)}(K),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(K),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(K),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,l){l=(l||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(u,l)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(o),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(K),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(c){u!==c&&(e.languages.markdown[u].inside.content.inside[c]=e.languages.markdown[c])})}),e.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||function c(f){if(f&&typeof f!="string")for(var h=0,d=f.length;h<d;h++){var p,m=f[h];m.type!=="code"?c(m.content):(p=m.content[1],m=m.content[3],p&&m&&p.type==="code-language"&&m.type==="code-block"&&typeof p.content=="string"&&(p=p.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),p="language-"+(p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase()),m.alias?typeof m.alias=="string"?m.alias=[m.alias,p]:m.alias.push(p):m.alias=[p]))}}(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var c="",f=0,h=u.classes.length;f<h;f++){var d=u.classes[f],d=/language-(.+)/.exec(d);if(d){c=d[1];break}}var p,m=e.languages[c];m?u.content=e.highlight(function(y){return y=y.replace(s,""),y=y.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,v){var x;return(v=v.toLowerCase())[0]==="#"?(x=v[1]==="x"?parseInt(v.slice(2),16):Number(v.slice(1)),l(x)):a[v]||g})}(u.content),m,c):c&&c!=="none"&&e.plugins.autoloader&&(p="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),u.attributes.id=p,e.plugins.autoloader.loadLanguages(c,function(){var y=document.getElementById(p);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[c],c))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(K),K.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:K.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},K.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(p){return typeof p!="string"&&p.type!=="comment"&&p.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(f(["definition-mutation","punctuation"])&&c(1).content==="("){n+=2;var o=h(/^\($/,/^\)$/);if(o===-1)continue;for(;n<o;n++){var s=c(0);s.type==="variable"&&(d(s,"variable-input"),i.push(s.content))}n=o+1}if(f(["punctuation","property-query"])&&c(0).content==="{"&&(n++,d(c(0),"property-mutation"),0<i.length)){var a=h(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var u=t[l];u.type==="variable"&&0<=i.indexOf(u.content)&&d(u,"variable-input")}}}}function c(p){return t[n+p]}function f(p,m){m=m||0;for(var y=0;y<p.length;y++){var g=c(y+m);if(!g||g.type!==p[y])return}return 1}function h(p,m){for(var y=1,g=n;g<t.length;g++){var v=t[g],x=v.content;if(v.type==="punctuation"&&typeof x=="string"){if(p.test(x))y++;else if(m.test(x)&&--y===0)return g}}return-1}function d(p,m){var y=p.alias;y?Array.isArray(y)||(p.alias=y=[y]):p.alias=y=[],y.push(m)}}),K.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],o=r.pattern.source;function s(f,h){if(e.languages[f])return{pattern:RegExp("((?:"+h+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function a(f,h,d){return f={code:f,grammar:h,language:d},e.hooks.run("before-tokenize",f),f.tokens=e.tokenize(f.code,f.grammar),e.hooks.run("after-tokenize",f),f.tokens}function l(f,h,d){var y=e.tokenize(f,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),p=0,m={},y=a(y.map(function(v){if(typeof v=="string")return v;for(var x,k,v=v.content;f.indexOf((k=p++,x="___"+d.toUpperCase()+"_"+k+"___"))!==-1;);return m[x]=v,x}).join(""),h,d),g=Object.keys(m);return p=0,function v(x){for(var k=0;k<x.length;k++){if(p>=g.length)return;var w,S,O,A,P,M,_,E=x[k];typeof E=="string"||typeof E.content=="string"?(w=g[p],(_=(M=typeof E=="string"?E:E.content).indexOf(w))!==-1&&(++p,S=M.substring(0,_),P=m[w],O=void 0,(A={})["interpolation-punctuation"]=i,(A=e.tokenize(P,A)).length===3&&((O=[1,1]).push.apply(O,a(A[1],e.languages.javascript,"javascript")),A.splice.apply(A,O)),O=new e.Token("interpolation",A,r.alias,P),A=M.substring(_+w.length),P=[],S&&P.push(S),P.push(O),A&&(v(M=[A]),P.push.apply(P,M)),typeof E=="string"?(x.splice.apply(x,[k,1].concat(P)),k+=P.length-1):E.content=P)):(_=E.content,Array.isArray(_)?v(_):v([_]))}}(y),new e.Token(d,y,"language-"+d,f)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function c(f){return typeof f=="string"?f:Array.isArray(f)?f.map(c).join(""):c(f.content)}e.hooks.add("after-tokenize",function(f){f.language in u&&function h(d){for(var p=0,m=d.length;p<m;p++){var y,g,v,x=d[p];typeof x!="string"&&(y=x.content,Array.isArray(y)?x.type==="template-string"?(x=y[1],y.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(g=c(x),x=x.alias,x=Array.isArray(x)?x[0]:x,v=e.languages[x])&&(y[1]=l(g,v,x))):h(y):typeof y!="string"&&h([y]))}}(f.tokens)})}(K),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(K),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(K),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(K),K.languages.n4js=K.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),K.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),K.languages.n4jsd=K.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var o=n[r],i=e.languages.javascript[o],o=(i=e.util.type(i)==="RegExp"?e.languages.javascript[o]={pattern:i}:i).inside||{};(i.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(K),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(l,u){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(l,u)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(l){for(var u=[],c=0;c<l.length;c++){var f=l[c],h=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<u.length&&u[u.length-1].tagName===a(f.content[0].content[1])&&u.pop():f.content[f.content.length-1].content!=="/>"&&u.push({tagName:a(f.content[0].content[1]),openedBraces:0}):0<u.length&&f.type==="punctuation"&&f.content==="{"?u[u.length-1].openedBraces++:0<u.length&&0<u[u.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?u[u.length-1].openedBraces--:h=!0),(h||typeof f=="string")&&0<u.length&&u[u.length-1].openedBraces===0&&(h=a(f),c<l.length-1&&(typeof l[c+1]=="string"||l[c+1].type==="plain-text")&&(h+=a(l[c+1]),l.splice(c+1,1)),0<c&&(typeof l[c-1]=="string"||l[c-1].type==="plain-text")&&(h=a(l[c-1])+h,l.splice(c-1,1),c--),l[c]=new e.Token("plain-text",h,null,h)),f.content&&typeof f.content!="string"&&s(f.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(K),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(K),K.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},K.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=K.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(K),K.languages.c=K.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),K.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),K.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},K.languages.c.string],char:K.languages.c.char,comment:K.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:K.languages.c}}}}),K.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete K.languages.c.boolean,K.languages.objectivec=K.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete K.languages.objectivec["class-name"],K.languages.objc=K.languages.objectivec,K.languages.reason=K.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),K.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete K.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(K),K.languages.go=K.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),K.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete K.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(K),K.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},K.languages.python["string-interpolation"].inside.interpolation.inside.rest=K.languages.python,K.languages.py=K.languages.python,K.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},K.languages.webmanifest=K.languages.json;var lPe={};iPe(lPe,{dracula:()=>cPe,duotoneDark:()=>hPe,duotoneLight:()=>pPe,github:()=>gPe,gruvboxMaterialDark:()=>VPe,gruvboxMaterialLight:()=>KPe,jettwaveDark:()=>LPe,jettwaveLight:()=>BPe,nightOwl:()=>vPe,nightOwlLight:()=>xPe,oceanicNext:()=>SPe,okaidia:()=>OPe,oneDark:()=>zPe,oneLight:()=>UPe,palenight:()=>APe,shadesOfPurple:()=>EPe,synthwave84:()=>_Pe,ultramin:()=>IPe,vsDark:()=>N5,vsLight:()=>NPe});var uPe={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},cPe=uPe,fPe={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},hPe=fPe,dPe={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},pPe=dPe,mPe={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},gPe=mPe,yPe={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},vPe=yPe,bPe={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},xPe=bPe,sr={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},wPe={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:sr.keyword}},{types:["attr-value"],style:{color:sr.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:sr.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:sr.primitive}},{types:["boolean"],style:{color:sr.boolean}},{types:["tag"],style:{color:sr.tag}},{types:["string"],style:{color:sr.string}},{types:["punctuation"],style:{color:sr.string}},{types:["selector","char","builtin","inserted"],style:{color:sr.char}},{types:["function"],style:{color:sr.function}},{types:["operator","entity","url","variable"],style:{color:sr.variable}},{types:["keyword"],style:{color:sr.keyword}},{types:["atrule","class-name"],style:{color:sr.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},SPe=wPe,kPe={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},OPe=kPe,CPe={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},APe=CPe,PPe={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},EPe=PPe,TPe={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},_Pe=TPe,MPe={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},IPe=MPe,jPe={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},N5=jPe,RPe={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},NPe=RPe,DPe={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},LPe=DPe,$Pe={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},BPe=$Pe,FPe={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},zPe=FPe,WPe={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},UPe=WPe,HPe={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},VPe=HPe,qPe={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},KPe=qPe,GPe=e=>C.useCallback(t=>{var n=t,{className:r,style:i,line:o}=n,s=R5(n,["className","style","line"]);const a=H0(Ui({},s),{className:Se("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof i=="object"&&(a.style=Ui(Ui({},a.style||{}),i)),a},[e]),QPe=e=>{const t=C.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return C.useCallback(n=>{var r=n,{token:i,className:o,style:s}=r,a=R5(r,["token","className","style"]);const l=H0(Ui({},a),{className:Se("token",...i.types,o),children:i.content,style:t(i)});return s!=null&&(l.style=Ui(Ui({},l.style||{}),s)),l},[t])},XPe=/\r\n|\r|\n/,Gj=e=>{e.length===0?e.push({types:["plain"],content:`
351
+ `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
352
+ `,e[0].empty=!0)},Qj=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},YPe=e=>{const t=[[]],n=[e],r=[0],i=[e.length];let o=0,s=0,a=[];const l=[a];for(;s>-1;){for(;(o=r[s]++)<i[s];){let u,c=t[s];const h=n[s][o];if(typeof h=="string"?(c=s>0?c:["plain"],u=h):(c=Qj(c,h.type),h.alias&&(c=Qj(c,h.alias)),u=h.content),typeof u!="string"){s++,t.push(c),n.push(u),r.push(0),i.push(u.length);continue}const d=u.split(XPe),p=d.length;a.push({types:c,content:d[0]});for(let m=1;m<p;m++)Gj(a),l.push(a=[]),a.push({types:c,content:d[m]})}s--,t.pop(),n.pop(),r.pop(),i.pop()}return Gj(a),l},Xj=YPe,ZPe=({prism:e,code:t,grammar:n,language:r})=>C.useMemo(()=>{if(n==null)return Xj([t]);const i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",i),Xj(i.tokens)},[t,n,r,e]),JPe=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((i,o)=>{const{languages:s,style:a}=o;return s&&!s.includes(t)||o.types.forEach(l=>{const u=Ui(Ui({},i[l]),a);i[l]=u}),i},{});return r.root=n,r.plain=H0(Ui({},n),{backgroundColor:void 0}),r},eEe=JPe,tEe=({children:e,language:t,code:n,theme:r,prism:i})=>{const o=t.toLowerCase(),s=eEe(r,o),a=GPe(s),l=QPe(s),u=i.languages[o],c=ZPe({prism:i,language:o,code:n,grammar:u});return e({tokens:c,className:`prism-code language-${o}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:l})},nEe=e=>C.createElement(tEe,H0(Ui({},e),{prism:e.prism||K,theme:e.theme||N5,code:e.code,language:e.language}));/*! Bundled license information:
353
+
354
+ prismjs/prism.js:
355
+ (**
356
+ * Prism: Lightweight, robust, elegant syntax highlighting
357
+ *
358
+ * @license MIT <https://opensource.org/licenses/MIT>
359
+ * @author Lea Verou <https://lea.verou.me>
360
+ * @namespace
361
+ * @public
362
+ *)
363
+ */const rEe={plain:{color:"var(--color-text)",backgroundColor:"transparent"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"var(--color-text-dim)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"var(--color-text-muted)"}},{types:["namespace"],style:{opacity:.7}},{types:["property","tag","boolean","number","constant","symbol","deleted"],style:{color:"var(--color-info)"}},{types:["selector","attr-name","string","char","builtin","inserted"],style:{color:"var(--color-ok)"}},{types:["operator","entity","url","variable"],style:{color:"var(--color-text)"}},{types:["atrule","attr-value","keyword"],style:{color:"var(--color-warn)"}},{types:["function","class-name"],style:{color:"var(--color-text)"}},{types:["regex","important"],style:{color:"var(--color-fail)"}}]};function oP({source:e}){return b.jsx("div",{className:"prose-docs max-w-none",children:b.jsx(KAe,{components:{code({className:t,children:n,...r}){const i=String(n);if(!(!!t?.startsWith("language-")||i.includes(`
364
+ `)))return b.jsx("code",{className:t,...r,children:n});const a=/language-(\w+)/.exec(t??"")?.[1]??"",l=String(n).replace(/\n$/,"");return a?b.jsx(nEe,{code:l,language:a,theme:rEe,children:({tokens:u,getLineProps:c,getTokenProps:f})=>b.jsx("pre",{className:"overflow-x-auto",children:u.map((h,d)=>b.jsx("div",{...c({line:h}),children:h.map((p,m)=>b.jsx("span",{...f({token:p})},m))},d))})}):b.jsx("pre",{className:"overflow-x-auto rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--gray-2)] p-3 text-[13px]",children:b.jsx("code",{className:t,children:n})})}},children:e})})}function sP({tabs:e,defaultIndex:t=0}){const n=C.useId(),[r,i]=C.useState(t),o=C.useCallback(s=>{s.key==="ArrowRight"?(s.preventDefault(),i(a=>(a+1)%e.length)):s.key==="ArrowLeft"?(s.preventDefault(),i(a=>(a-1+e.length)%e.length)):s.key==="Home"?(s.preventDefault(),i(0)):s.key==="End"&&(s.preventDefault(),i(e.length-1))},[e.length]);return b.jsxs("div",{children:[b.jsx("div",{role:"tablist","aria-orientation":"horizontal",className:"flex gap-4 border-b border-[var(--color-border)]",onKeyDown:o,children:e.map((s,a)=>{const l=a===r;return b.jsx("button",{type:"button",role:"tab",id:`${n}-tab-${s.id}`,"aria-selected":l,"aria-controls":`${n}-panel-${s.id}`,tabIndex:l?0:-1,className:l?"relative -mb-px border-b-2 border-[var(--color-text)] px-1 py-2 text-[13px] font-medium text-[var(--color-text)]":"relative -mb-px border-b-2 border-transparent px-1 py-2 text-[13px] text-[var(--color-text-muted)] hover:text-[var(--color-text)]",onClick:()=>i(a),children:s.label},s.id)})}),e.map((s,a)=>b.jsx("div",{id:`${n}-panel-${s.id}`,role:"tabpanel","aria-labelledby":`${n}-tab-${s.id}`,hidden:a!==r,className:"pt-4",children:a===r?s.panel:null},s.id))]})}function iEe({value:e,onChange:t,rows:n=20}){return b.jsx("textarea",{className:"w-full min-h-[320px] rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-elevated)] px-3 py-2 text-sm text-[var(--color-text)] placeholder:text-[var(--color-text-dim)] outline-none focus:border-[var(--color-border-strong)] font-mono",value:e,rows:n,onChange:r=>t(r.target.value)})}function oEe(){const{feature:e,id:t}=Hd({from:"/stories/$feature/$id"}),n=mi(),r=Qi(),i=Vv(),{toast:o}=Do(),[s,a]=C.useState(null),[l,u]=C.useState(!0),c=Jt({queryKey:["story",e,t],queryFn:()=>Be(`/api/stories/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)});C.useEffect(()=>{a(null)},[e,t]);const f=c.data?.intakeContent??"",h=s!==null?s:f,d=Wa({mutationFn:v=>Be("/api/stories/"+encodeURIComponent(e)+"/"+encodeURIComponent(t),{method:"PATCH",body:JSON.stringify({intakeContent:v})}),onSuccess:()=>{r.invalidateQueries({queryKey:["stories"]}),r.invalidateQueries({queryKey:["story",e,t]})}}),p=Wa({mutationFn:()=>Be(`/api/stories/${encodeURIComponent(e)}/${encodeURIComponent(t)}?trash=${l?"1":"0"}`,{method:"DELETE"}),onSuccess:()=>{r.invalidateQueries({queryKey:["stories"]}),o({tone:"success",title:"Story deleted"}),n({to:"/stories"})}});async function m(){await i({title:`Delete ${t}?`,description:`This removes the story folder from .squad/stories/${e}/${t}/.`,tone:"danger",confirmLabel:"Delete story"})&&p.mutate()}if(c.isLoading)return b.jsx(Fe,{title:t,description:"…",children:b.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading…"})});if(c.isError)return b.jsx(Fe,{title:t,description:"…",children:b.jsx(Ge,{tone:"danger",children:c.error.message})});if(!c.data)return null;const y=c.data,g=y.titleHint??t;return b.jsx(Fe,{title:g,description:b.jsxs("span",{children:[b.jsx("span",{className:"font-mono text-[13px] text-[var(--color-text-muted)]",children:y.id}),y.planFile?b.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[" ","· plan ",b.jsx("span",{className:"font-mono",children:y.planFile})]}):null]}),actions:b.jsx(be,{type:"button",variant:"danger",leftIcon:b.jsx(Nh,{size:14}),onClick:()=>void m(),children:"Delete story"}),children:b.jsxs("div",{className:"grid gap-6 lg:grid-cols-[minmax(0,1fr)_280px]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"mb-4 flex items-center gap-2 text-sm",children:b.jsx(ln,{to:"/stories",className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"← Stories"})}),b.jsx(sP,{defaultIndex:0,tabs:[{id:"preview",label:"Preview",panel:b.jsx(oP,{source:y.intakeContent})},{id:"edit",label:"Edit",panel:b.jsxs("div",{className:"space-y-3",children:[b.jsx(iEe,{value:h,onChange:v=>a(v)}),b.jsx(be,{type:"button",onClick:()=>{d.mutate(h)},disabled:d.isPending,children:"Save"})]})}]}),b.jsx("div",{className:"mt-6 border-t border-[var(--color-border)] pt-4",children:b.jsxs("label",{className:"mb-3 flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[b.jsx("input",{type:"checkbox",checked:l,onChange:v=>u(v.target.checked),className:"rounded"}),"Move to trash (instead of permanent delete)"]})})]}),b.jsxs(nt,{className:"h-fit",variant:"default",children:[b.jsx("h3",{className:"mb-3 text-sm font-semibold text-[var(--color-text-dim)]",children:"Metadata"}),b.jsxs("dl",{className:"space-2 text-sm",children:[b.jsxs("div",{children:[b.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"Feature"}),b.jsx("dd",{className:"font-mono",children:y.feature})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"Id"}),b.jsx("dd",{className:"font-mono break-all",children:y.id})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"intake.md"}),b.jsx("dd",{className:"font-mono text-xs break-all text-[var(--color-text-muted)]",children:y.intakePath})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-[var(--color-text-dim)]",children:"Plan"}),b.jsx("dd",{children:y.planFile?b.jsx(ln,{to:"/plans/$feature/$planFile",params:{feature:y.feature,planFile:y.planFile},className:"text-[var(--color-accent)] underline",children:y.planFile}):"—"})]})]})]})]})})}const sEe={sm:"h-7 w-7",md:"h-8 w-8"},aEe={ghost:"text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--gray-3)]",secondary:"border border-[var(--color-border)] bg-[var(--gray-3)] text-[var(--color-text)] hover:bg-[var(--gray-4)]"},wk=C.forwardRef(function({icon:t,label:n,size:r="md",variant:i="ghost",className:o="",...s},a){return b.jsx(jg,{label:n,children:b.jsx("button",{ref:a,type:"button","aria-label":n,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-colors ${sEe[r]} ${aEe[i]} ${o}`,...s,children:t})})});function lEe(e){const t=new Map;for(const n of e){const r=t.get(n.feature)??[];r.push(n),t.set(n.feature,r)}return[...t.entries()].sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>({feature:n,plans:r.sort((i,o)=>i.planFile.localeCompare(o.planFile))}))}function uEe(){const e=Qi(),t=mi(),n=Vv(),{toast:r}=Do(),[i,o]=C.useState(null),s=Jt({queryKey:["plans"],queryFn:()=>Be("/api/plans")}),a=Wa({mutationFn:({feature:f,planFile:h})=>Be(`/api/plans/${encodeURIComponent(f)}/${encodeURIComponent(h)}?trash=1`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["plans"]})}});async function l(f){await n({title:`Delete ${f.planFile}?`,description:"The plan file will be moved to trash.",tone:"danger",confirmLabel:"Delete"})&&(await a.mutateAsync({feature:f.feature,planFile:f.planFile}),r({tone:"success",title:"Plan deleted"}))}if(s.isLoading)return b.jsx(Fe,{title:"Plans",description:"Generated plan files. Compare versions and clean up old drafts.",children:b.jsx("div",{className:"space-y-2",children:Array.from({length:6}).map((f,h)=>b.jsx(Nr,{className:"h-9"},h))})});if(s.isError)return b.jsx(Fe,{title:"Plans",description:"Generated plan files. Compare versions and clean up old drafts.",children:b.jsx(Ge,{tone:"danger",children:s.error.message})});const u=lEe(s.data??[]),c=s.data??[];return b.jsxs(Fe,{title:"Plans",description:"Generated plan files. Compare versions and clean up old drafts.",children:[u.length===0?b.jsx(Ge,{tone:"info",children:"No plan files found."}):b.jsx("div",{className:"space-y-8",children:u.map(({feature:f,plans:h})=>b.jsxs("div",{children:[b.jsx("div",{className:"mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider text-[var(--color-text-dim)]",children:f}),b.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:h.map((d,p)=>{const m=d.planFile.endsWith(".partial.md"),y=d.metadata?.generatedBy??d.metadata?.model??"—",g=c.some(v=>v.feature===d.feature&&v.planFile!==d.planFile);return b.jsxs("li",{className:"flex flex-wrap items-center gap-3 border-[var(--color-border)] px-3 py-[var(--space-row-y)] "+(p>0?"border-t":""),children:[b.jsx(ln,{to:"/plans/$feature/$planFile",params:{feature:d.feature,planFile:d.planFile},className:"min-w-0 flex-1 break-all font-mono text-[13px] text-[var(--color-text)] hover:underline",children:d.planFile}),b.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[m?b.jsx(Et,{tone:"warning",children:"partial"}):null,b.jsx("span",{className:"chip max-w-[200px] truncate",title:y,children:y}),g?b.jsx(wk,{icon:b.jsx(QB,{size:14}),label:"Compare with…",onClick:()=>o(d)}):null,b.jsx(wk,{icon:b.jsx(Nh,{size:14}),label:"Delete plan",onClick:()=>void l(d)})]})]},d.planFile)})})]},f))}),b.jsx(Sc,{open:i!==null,onClose:()=>o(null),title:"Compare with",footer:b.jsx(be,{type:"button",variant:"secondary",onClick:()=>o(null),children:"Close"}),children:i?(()=>{const f=c.filter(h=>h.feature===i.feature&&h.planFile!==i.planFile);return f.length===0?b.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"No other plans in this feature to compare."}):b.jsx("ul",{className:"space-y-1",children:f.map(h=>b.jsx("li",{children:b.jsx("button",{type:"button",className:"w-full text-left font-mono text-sm text-[var(--color-accent)] hover:underline",onClick:()=>{const d=i.planFile,p=h.planFile,m=i.feature;o(null),t({to:"/plans/$feature/diff",params:{feature:m},search:{a:d,b:p}})},children:h.planFile})},h.planFile))})})():null})]})}function cEe(){const{feature:e,planFile:t}=Hd({from:"/plans/$feature/$planFile"}),n=mi(),r=Qi(),i=Vv(),{toast:o}=Do(),[s,a]=C.useState(!1),[l,u]=C.useState(!0),[c,f]=C.useState(null),h=Jt({queryKey:["plan",e,t],queryFn:()=>Be(`/api/plans/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}),d=Jt({queryKey:["plans"],queryFn:()=>Be("/api/plans")}),p=C.useMemo(()=>(d.data??[]).filter(w=>w.feature===e&&w.planFile!==t),[d.data,e,t]),m=Wa({mutationFn:()=>Be(`/api/plans/${encodeURIComponent(e)}/${encodeURIComponent(t)}?trash=${l?"1":"0"}`,{method:"DELETE"}),onSuccess:()=>{r.invalidateQueries({queryKey:["plans"]}),o({tone:"success",title:"Plan deleted"}),n({to:"/plans"})}});async function y(){await i({title:`Delete ${t}?`,description:`Remove ${t} ${l?"to the trash folder":"permanently"}.`,tone:"danger",confirmLabel:"Delete plan"})&&m.mutate()}if(h.isLoading)return b.jsx(Fe,{title:t,description:"…",children:b.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading…"})});if(h.isError)return b.jsx(Fe,{title:t,description:"…",children:b.jsx(Ge,{tone:"danger",children:h.error.message})});if(!h.data)return null;const g=h.data,v=g.metadata?.generatedBy?`${g.metadata.provider??""}/${g.metadata.model??g.metadata.generatedBy}`.replace(/^\//,""):"—",x=()=>{const w=g.absPath;window.location.href=`vscode://file${w.startsWith("/")?"":"/"}${w}`.replace(/\s/g,"%20")},k=async()=>{try{await navigator.clipboard.writeText(g.absPath),f("Path copied"),setTimeout(()=>f(null),2e3)}catch{f("Copy failed (browser blocked)")}};return b.jsxs(Fe,{title:b.jsx("span",{className:"break-all font-mono",children:g.planFile}),description:`Generated by ${v}`,actions:b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx(be,{type:"button",variant:"secondary",onClick:x,children:"Open in editor"}),b.jsx(be,{type:"button",variant:"secondary",onClick:k,children:"Copy path"}),c?b.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:c}):null,p.length>0?b.jsx(be,{type:"button",variant:"secondary",leftIcon:b.jsx(QB,{size:14}),onClick:()=>a(!0),children:"Compare with…"}):null,b.jsx(be,{type:"button",variant:"danger",leftIcon:b.jsx(Nh,{size:14}),onClick:()=>void y(),children:"Delete plan"})]}),children:[b.jsx("div",{className:"mb-4 text-sm",children:b.jsx(ln,{to:"/plans",className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"← Plans"})}),b.jsxs("label",{className:"mb-4 flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[b.jsx("input",{type:"checkbox",checked:l,onChange:w=>u(w.target.checked),className:"rounded"}),"Move to trash"]}),b.jsxs("details",{className:"mb-6 rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-elevated)] p-3 text-sm",children:[b.jsx("summary",{className:"cursor-pointer text-[var(--color-text-dim)]",children:"Metadata"}),b.jsx("pre",{className:"mt-2 overflow-x-auto text-xs text-[var(--color-text-muted)]",children:JSON.stringify(g.metadata,null,2)})]}),b.jsx(oP,{source:g.content}),b.jsx(Sc,{open:s,onClose:()=>a(!1),title:"Compare with",footer:b.jsx(be,{type:"button",variant:"secondary",onClick:()=>a(!1),children:"Close"}),children:b.jsx("ul",{className:"space-y-1",children:p.map(w=>b.jsx("li",{children:b.jsx("button",{type:"button",className:"w-full text-left font-mono text-sm text-[var(--color-accent)] hover:underline",onClick:()=>{a(!1),n({to:"/plans/$feature/diff",params:{feature:e},search:{a:t,b:w.planFile}})},children:w.planFile})},w.planFile))})})]})}const fEe=5;function hEe(e){return e.value.replace(/\n$/,"").split(`
365
+ `)}const Jp={color:"var(--color-text)"},dEe={background:"var(--color-fail-bg)",color:"var(--color-fail)",borderLeft:"3px solid var(--color-fail)"},pEe={background:"var(--color-ok-bg)",color:"var(--color-ok)",borderLeft:"3px solid var(--color-ok)"};function mEe(){const{feature:e}=Hd({from:"/plans/$feature/diff"}),{a:t,b:n}=Vd({from:"/plans/$feature/diff"}),r=mi(),[i,o]=C.useState(()=>new Set),s=Jt({queryKey:["planDiff",e,t,n],enabled:!!(t&&n),queryFn:()=>Be(`/api/plans/diff?feature=${encodeURIComponent(e)}&a=${encodeURIComponent(t)}&b=${encodeURIComponent(n)}`)});if(!t||!n)return b.jsx(Fe,{title:"Plan diff",description:"Compare two plan files.",children:b.jsx(Ge,{tone:"warning",children:"Select two plan files to compare (missing a or b)."})});if(s.isLoading)return b.jsx(Fe,{title:"Plan diff",description:`${t} ↔ ${n}`,children:b.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Computing diff…"})});if(s.isError)return b.jsx(Fe,{title:"Plan diff",description:`${t} ↔ ${n}`,children:b.jsx(Ge,{tone:"danger",children:s.error.message})});if(!s.data)return null;const a=()=>{r({to:"/plans/$feature/diff",params:{feature:e},search:{a:n,b:t}})};return b.jsxs(Fe,{title:"Plan diff",description:`${t} ↔ ${n}`,children:[b.jsx("div",{className:"mb-4 text-sm",children:b.jsx(ln,{to:"/plans",className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"← Plans"})}),b.jsx("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:b.jsx(be,{type:"button",variant:"secondary",onClick:a,children:"Swap A ↔ B"})}),b.jsxs("div",{className:"mb-2 grid grid-cols-2 gap-2 text-xs text-[var(--color-text-dim)]",children:[b.jsxs("div",{className:"truncate pr-1 font-mono",children:["A: ",t]}),b.jsxs("div",{className:"truncate pl-1 font-mono",children:["B: ",n]})]}),b.jsx(nt,{variant:"inset",children:b.jsx("div",{className:"space-y-2",children:s.data.changes.map((l,u)=>{if(!l.added&&!l.removed){const d=hEe(l),p=d.length>fEe&&!i.has(u),m=p?`${d.slice(0,2).join(`
366
+ `)}
367
+ … ${d.length-4} unchanged lines hidden …
368
+ ${d.slice(-2).join(`
369
+ `)}`:d.join(`
370
+ `);return b.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[b.jsxs("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:Jp,children:[m,p&&b.jsx("div",{className:"mt-1",children:b.jsxs(be,{type:"button",variant:"ghost",onClick:()=>o(y=>new Set(y).add(u)),children:["Expand ",d.length-4," lines"]})})]}),b.jsxs("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:Jp,children:[m,p&&b.jsx("div",{className:"mt-1",children:b.jsxs(be,{type:"button",variant:"ghost",onClick:()=>o(y=>new Set(y).add(u)),children:["Expand ",d.length-4," lines"]})})]})]},u)}const f=l.added?"":l.value.endsWith(`
371
+ `)?l.value.slice(0,-1):l.value,h=l.removed?"":l.value.endsWith(`
372
+ `)?l.value.slice(0,-1):l.value;return b.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[b.jsx("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:l.removed?dEe:Jp,children:f}),b.jsx("div",{className:"min-w-0 rounded border border-[var(--color-border)] p-2 font-mono text-xs whitespace-pre-wrap break-words",style:l.added?pEe:Jp,children:h})]},u)})})})]})}const gEe={phase:"idle",runId:null,startedAtMs:null,tick:0,turn:0,cacheHitPct:null,tokenIn:0,tokenOut:0,tokenCeiling:32e3,fileReads:[],assistantMd:"",planFile:null,feature:"",storyId:"",mode:"api",error:null};function yEe(e,t){switch(t.type){case"set_story":return{...e,feature:t.feature,storyId:t.storyId};case"set_mode":return{...e,mode:t.mode};case"start_post":return{...e,phase:"starting",error:null,assistantMd:"",fileReads:[],cacheHitPct:null,tokenIn:0,tokenOut:0,turn:0,planFile:null,startedAtMs:Date.now()};case"start_stream":return{...e,phase:"streaming",runId:t.runId,startedAtMs:e.startedAtMs??Date.now()};case"resume":return{...e,phase:"streaming",runId:t.runId,feature:t.feature,storyId:t.storyId,assistantMd:"",fileReads:[],cacheHitPct:null,tokenIn:0,tokenOut:0,turn:0,planFile:null,error:null,startedAtMs:Date.now()};case"reset_stream_ui":return{...e,assistantMd:"",fileReads:[],cacheHitPct:null,tokenIn:0,tokenOut:0,turn:0,planFile:null};case"tick":return{...e,tick:e.tick+1};case"fail":return{...e,phase:"failed",error:t.message,runId:null};case"sse":{const n=t.event;let r=e;if(n.kind==="usage"&&n.usage){const i=n.usage.inputTokens??e.tokenIn,o=n.usage.outputTokens??e.tokenOut,s=i+o,a=Math.max(e.tokenCeiling,Math.ceil(s*1.15),1024);r={...r,tokenIn:i,tokenOut:o,tokenCeiling:a}}if(n.kind==="cache_summary"&&n.cacheHitRatio!==void 0&&(r={...r,cacheHitPct:Math.round(n.cacheHitRatio*100)}),n.kind==="tool_call"&&n.toolCall){const i=n.toolCall.input?.path??"<unknown>",o=n.bytesLoaded!==void 0?`${(n.bytesLoaded/1024).toFixed(1)} KB`:"—";r={...r,fileReads:[...r.fileReads,{id:`${r.runId}-${r.fileReads.length}`,path:i,kb:o}]}}if(n.kind==="assistant_text"&&n.delta&&(r={...r,assistantMd:r.assistantMd+n.delta}),n.turn!==void 0&&(r={...r,turn:n.turn}),n.kind==="cancelled"&&(r={...r,phase:"cancelled"}),n.kind==="done"){if(r.phase==="failed"&&r.error)return{...r,planFile:n.planFile??r.planFile};const i=r.phase==="cancelled";r={...r,planFile:n.planFile??null},n.success?r={...r,phase:"done",error:null}:i||n.partial?r={...r,phase:"cancelled"}:r={...r,phase:"failed",error:"Planning did not finish cleanly."}}return n.kind==="error"&&n.message&&(r={...r,phase:"failed",error:n.message}),r}default:return e}}function vEe(e,t){C.useEffect(()=>{if(!e)return;const n=sessionStorage.getItem("squad.console.token");if(!n)return;const r=`/api/runs/${encodeURIComponent(e)}/stream?t=${encodeURIComponent(n)}`,i=new EventSource(r),o=(a,l)=>{i.addEventListener(a,u=>l(u.data))},s=a=>{try{const l=JSON.parse(a);t({type:"sse",event:l})}catch{}};return o("started",s),o("turn_started",s),o("request_sent",s),o("usage",s),o("cache_summary",s),o("tool_call",s),o("assistant_text",s),o("rate_limit",s),o("turn_complete",s),o("done",s),o("error",s),o("cancelled",s),o("ping",()=>{}),i.addEventListener("closed",()=>{i.close()}),()=>{i.close()}},[e,t])}function bEe({state:e,elapsedSec:t,tokenPct:n,cancelRun:r}){const i=e.phase==="idle"?"idle":e.phase==="starting"||e.phase==="streaming"?"running":e.phase==="done"?"succeeded":e.phase==="cancelled"?"cancelled":e.phase==="failed"?"failed":"—",o=i==="running"?"info":i==="succeeded"?"success":i==="failed"?"danger":i==="cancelled"?"warning":"default";return b.jsxs("div",{className:"rounded-xl border border-[var(--color-border)] bg-[var(--color-surface)] p-4",children:[b.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2 text-sm",children:[b.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[i==="running"?b.jsx(Hv,{size:"sm","aria-hidden":!0}):null,b.jsx(Et,{tone:o,dot:i==="running",children:i})]}),b.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["turn ",e.turn,(e.phase==="streaming"||e.phase==="starting")&&` · ${t}s`,e.cacheHitPct!=null&&` · cache hit ${e.cacheHitPct}%`]})]}),b.jsxs("div",{className:"mb-3",children:[b.jsxs("div",{className:"mb-1 flex justify-between text-xs text-[var(--color-text-muted)]",children:[b.jsxs("span",{children:["tokens ",e.tokenIn," in · ",e.tokenOut," out"]}),b.jsxs("span",{className:"tabular",children:[n,"%"]})]}),b.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-[var(--gray-3)]",children:b.jsx("div",{className:"h-full bg-[var(--color-text)] transition-[width] duration-300",style:{width:`${n}%`}})})]}),b.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"File reads"}),b.jsxs("ul",{className:"max-h-48 space-y-1 overflow-y-auto text-sm",children:[e.fileReads.map(s=>b.jsxs("li",{className:"flex justify-between gap-2 border-b border-[var(--color-border)]/50 py-1",children:[b.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 font-mono text-xs text-[var(--color-text)]",children:[b.jsx(pQ,{size:12,className:"shrink-0 text-[var(--color-ok)]","aria-hidden":!0}),b.jsx("span",{className:"truncate",children:s.path})]}),b.jsx("span",{className:"shrink-0 tabular text-[var(--color-text-muted)]",children:s.kb})]},s.id)),(e.phase==="streaming"||e.phase==="starting")&&b.jsx("li",{className:"text-xs text-[var(--color-text-muted)]",children:"◓ working…"})]})]}),b.jsxs("div",{children:[b.jsx("h2",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-[var(--color-text-muted)]",children:"Assistant"}),b.jsx("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-[var(--color-border)] bg-[var(--gray-2)] p-3 text-sm",children:e.assistantMd?b.jsx(oP,{source:e.assistantMd}):b.jsx("span",{className:"text-[var(--color-text-muted)]",children:"Waiting for model…"})})]})]}),(e.phase==="streaming"||e.phase==="starting")&&b.jsx("div",{className:"mt-4 flex justify-end",children:b.jsx(be,{type:"button",variant:"danger",leftIcon:b.jsx(nF,{size:14}),onClick:r,children:"Cancel run"})})]})}function xEe(){const[e,t]=C.useReducer(yEe,gEe),{toast:n}=Do(),{feature:r,storyId:i}=Vd({from:"/generate"}),o=r&&i?`${r}:${i}`:"",s=C.useRef(null),a=Jt({queryKey:["stories"],queryFn:()=>Be("/api/stories")}),l=Jt({queryKey:["config"],queryFn:()=>Be("/api/config")}),u=Jt({queryKey:["copy-plan-prompt",e.feature,e.storyId],queryFn:()=>Be(`/api/copy-plan-prompt?feature=${encodeURIComponent(e.feature)}&storyId=${encodeURIComponent(e.storyId)}`),enabled:e.mode==="copy"&&!!(e.feature&&e.storyId)}),c=!!l.data?.planner?.enabled,f=C.useMemo(()=>(a.data??[]).filter(k=>!k.planFile),[a.data]),h=C.useMemo(()=>Qz(f).map(x=>x.feature),[f]);C.useEffect(()=>{if(!f.length)return;if(o&&o!==s.current){const k=f.find(w=>w.feature===r&&w.id===i);if(k){t({type:"set_story",feature:k.feature,storyId:k.id}),s.current=o;return}s.current=o}if(e.feature)return;const x=[...f].sort((k,w)=>{const S=`${k.feature}/${k.id}`;return`${w.feature}/${w.id}`.localeCompare(S)})[0];x&&t({type:"set_story",feature:x.feature,storyId:x.id})},[f,e.feature,o,r,i]),C.useEffect(()=>{let x=!1;return(async()=>{if(!(e.phase!=="idle"||!a.data))try{const k=await Be("/api/runs/active");if(x||k.length!==1)return;const w=k[0];t({type:"resume",runId:w.runId,feature:w.feature,storyId:w.storyId})}catch{}})(),()=>{x=!0}},[e.phase,a.data]),C.useEffect(()=>{if(e.phase!=="streaming"&&e.phase!=="starting")return;const x=window.setInterval(()=>t({type:"tick"}),500);return()=>clearInterval(x)},[e.phase]);const d=C.useCallback(x=>t(x),[]);vEe(e.runId,d);const p=e.startedAtMs!=null&&(e.phase==="streaming"||e.phase==="starting")||e.startedAtMs!=null?Math.floor((Date.now()-e.startedAtMs)/1e3):0,m=Math.min(100,Math.round((e.tokenIn+e.tokenOut)/e.tokenCeiling*100)),y=async()=>{if(e.mode!=="copy"&&!(!e.feature||!e.storyId)){t({type:"start_post"});try{const x=await fetch("/api/runs",{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${sessionStorage.getItem("squad.console.token")??""}`},body:JSON.stringify({feature:e.feature,storyId:e.storyId})});if(x.status===401)throw new $r;if(!x.ok){const w=await x.json().catch(()=>({}));throw new Error(w.detail??w.error??`${x.status}`)}const k=await x.json();t({type:"start_stream",runId:k.runId})}catch(x){t({type:"fail",message:x instanceof Error?x.message:String(x)})}}},g=async()=>{if(e.runId)try{await fetch(`/api/runs/${encodeURIComponent(e.runId)}`,{method:"DELETE",headers:{authorization:`Bearer ${sessionStorage.getItem("squad.console.token")??""}`}})}catch{}};return a.error instanceof $r||l.error instanceof $r||u.error instanceof $r?b.jsx(Fe,{title:"Generate plan",description:"Run the planner against an intake; stream file reads and draft text live.",children:b.jsxs(Ge,{tone:"warning",title:"Session expired or missing token.",children:["Reopen ",b.jsx("kbd",{className:"kbd",children:"squad console"})," from your project."]})}):b.jsxs(Fe,{title:"Generate plan",description:"Run the planner against an intake; stream file reads and draft text live.",children:[!c&&b.jsxs(Ge,{tone:"warning",title:"Planner API is not enabled in config.",children:["Run ",b.jsx("code",{className:"text-xs",children:"squad config set planner"})," or open the"," ",b.jsx(ln,{to:"/config",className:"text-[var(--color-accent)] underline",children:"Config"})," ","tab."]}),c&&b.jsxs(Ge,{tone:"info",title:"Provider keys",children:["API runs need a provider key in"," ",b.jsx(ln,{to:"/secrets",className:"text-[var(--color-accent)] underline",children:"Secrets"})," ","or in your shell (",b.jsx("code",{className:"text-xs",children:"ANTHROPIC_API_KEY"}),", etc.)."]}),b.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[b.jsxs("label",{className:"flex min-w-[140px] flex-col gap-1 text-xs text-[var(--color-text-muted)]",children:["Feature",b.jsxs(ac,{value:e.feature,disabled:h.length===0,onChange:x=>{const k=x.target.value,w=f.find(S=>S.feature===k);t({type:"set_story",feature:k,storyId:w?.id??""})},children:[b.jsx("option",{value:"",children:"—"}),h.map(x=>b.jsx("option",{value:x,children:x},x))]})]}),b.jsxs("label",{className:"flex min-w-[180px] flex-col gap-1 text-xs text-[var(--color-text-muted)]",children:["Story",b.jsxs(ac,{value:e.storyId,disabled:!e.feature,onChange:x=>t({type:"set_story",feature:e.feature,storyId:x.target.value}),children:[b.jsx("option",{value:"",children:"—"}),f.filter(x=>x.feature===e.feature).map(x=>b.jsxs("option",{value:x.id,children:[x.id,x.titleHint?` — ${x.titleHint}`:""]},`${x.feature}/${x.id}`))]})]}),b.jsxs("fieldset",{className:"flex gap-4 text-sm text-[var(--color-text)]",children:[b.jsx("legend",{className:"sr-only",children:"Mode"}),b.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[b.jsx("input",{type:"radio",name:"mode",checked:e.mode==="api",disabled:!c,onChange:()=>t({type:"set_mode",mode:"api"})}),"API"]}),b.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[b.jsx("input",{type:"radio",name:"mode",checked:e.mode==="copy",onChange:()=>t({type:"set_mode",mode:"copy"})}),"Copy"]})]}),b.jsx(be,{type:"button",disabled:!e.feature||!e.storyId||e.mode!=="api"||!c||e.phase==="streaming"||e.phase==="starting",onClick:()=>void y(),children:"Run"})]}),e.mode==="copy"&&b.jsx("div",{className:"mt-6 space-y-4",children:!e.feature||!e.storyId?b.jsxs(Ge,{tone:"info",title:"Choose a story first",children:["Pick a feature and story above. The console loads the same meta-prompt as"," ",b.jsx("code",{className:"text-xs",children:"squad new-plan <intake> --copy"})," — no provider keys needed in the browser."]}):u.isLoading?b.jsxs("div",{className:"flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[b.jsx(Hv,{}),"Building prompt…"]}):u.isError?b.jsx(Ge,{tone:"danger",title:"Could not load prompt",children:u.error instanceof Error?u.error.message:String(u.error)}):u.data?b.jsxs(b.Fragment,{children:[b.jsx(Ge,{tone:"info",title:"Copy-paste planning (no API spend here)",children:b.jsxs("ol",{className:"mt-2 list-decimal space-y-1.5 pl-4 text-sm text-[var(--color-text-muted)]",children:[b.jsxs("li",{children:["Click ",b.jsx("strong",{className:"text-[var(--color-text)]",children:"Copy full prompt"})," (or select the box and ⌘C / Ctrl+C)."]}),b.jsx("li",{children:"Open your agent (Cursor, Claude Code, Copilot, Gemini) and paste into a new chat."}),b.jsx("li",{children:"Switch to a strong planning model, then let the agent read the repo and write the plan file."}),b.jsxs("li",{children:["The agent saves under"," ",b.jsxs("code",{className:"text-xs",children:[".squad/plans/",u.data.feature,"/"]}),". For a CLI-only refresh, you can still run"," ",b.jsx("code",{className:"text-xs",children:"squad new-plan --copy"})," in a terminal — same bytes."]})]})}),b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[b.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["~",u.data.estTokensApprox.toLocaleString()," tokens (est) ·"," ",(u.data.bytes/1024).toFixed(1)," KB"]}),b.jsx(be,{type:"button",variant:"secondary",leftIcon:b.jsx(yQ,{size:14,"aria-hidden":!0}),onClick:()=>{(async()=>{try{await navigator.clipboard.writeText(u.data.prompt),n({tone:"success",title:"Full prompt copied"})}catch{n({tone:"warning",title:"Clipboard blocked",description:"Select the text in the box and copy manually (⌘C / Ctrl+C)."})}})()},children:"Copy full prompt"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"text-xs font-medium text-[var(--color-text-muted)]",htmlFor:"copy-prompt-preview",children:"Prompt preview (scroll — button copies the entire prompt, not just this view)"}),b.jsx("textarea",{id:"copy-prompt-preview",readOnly:!0,spellCheck:!1,rows:14,className:"mt-1 w-full max-h-64 min-h-[12rem] resize-y rounded-lg border border-[var(--color-border)] bg-[var(--gray-2)] p-3 font-mono text-[11px] leading-relaxed text-[var(--color-text)]",value:u.data.prompt})]})]}):null}),(e.phase==="streaming"||e.phase==="starting"||e.phase==="done"||e.phase==="failed"||e.phase==="cancelled")&&b.jsx(bEe,{state:e,elapsedSec:p,tokenPct:m,cancelRun:()=>void g()}),e.phase==="done"&&e.planFile&&b.jsx(Ge,{tone:"success",title:"Plan saved",action:b.jsx(ln,{to:"/plans/$feature/$planFile",params:{feature:e.feature,planFile:e.planFile},className:"text-[13px] font-medium text-[var(--color-accent)] hover:underline",children:"Open"}),children:b.jsx("span",{className:"font-mono",children:e.planFile})}),e.phase==="cancelled"&&e.planFile&&b.jsx(Ge,{tone:"warning",title:"Saved partial plan",action:b.jsx(ln,{to:"/plans/$feature/$planFile",params:{feature:e.feature,planFile:e.planFile},className:"text-[13px] font-medium text-[var(--color-accent)] hover:underline",children:"Open"}),children:b.jsx("span",{className:"font-mono",children:e.planFile})}),e.error&&e.phase==="failed"&&b.jsx(Ge,{tone:"danger",title:"Run failed",children:e.error})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function D5(e){return typeof e>"u"||e===null}function wEe(e){return typeof e=="object"&&e!==null}function SEe(e){return Array.isArray(e)?e:D5(e)?[]:[e]}function kEe(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n<r;n+=1)i=o[n],e[i]=t[i];return e}function OEe(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function CEe(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var AEe=D5,PEe=wEe,EEe=SEe,TEe=OEe,_Ee=CEe,MEe=kEe,Wt={isNothing:AEe,isObject:PEe,toArray:EEe,repeat:TEe,isNegativeZero:_Ee,extend:MEe};function L5(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
373
+
374
+ `+e.mark.snippet),r+" "+n):r}function vd(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=L5(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}vd.prototype=Object.create(Error.prototype);vd.prototype.constructor=vd;vd.prototype.toString=function(t){return this.name+": "+L5(this,t)};var Tn=vd;function zx(e,t,n,r,i){var o="",s="",a=Math.floor(i/2)-1;return r-t>a&&(o=" ... ",t=r-a+o.length),n-r>a&&(s=" ...",n=r+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+o.length}}function Wx(e,t){return Wt.repeat(" ",t-e.length)+e}function IEe(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],o,s=-1;o=n.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=r.length-2);s<0&&(s=r.length-1);var a="",l,u,c=Math.min(e.line+t.linesAfter,i.length).toString().length,f=t.maxLength-(t.indent+c+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=zx(e.buffer,r[s-l],i[s-l],e.position-(r[s]-r[s-l]),f),a=Wt.repeat(" ",t.indent)+Wx((e.line-l+1).toString(),c)+" | "+u.str+`
375
+ `+a;for(u=zx(e.buffer,r[s],i[s],e.position,f),a+=Wt.repeat(" ",t.indent)+Wx((e.line+1).toString(),c)+" | "+u.str+`
376
+ `,a+=Wt.repeat("-",t.indent+c+3+u.pos)+`^
377
+ `,l=1;l<=t.linesAfter&&!(s+l>=i.length);l++)u=zx(e.buffer,r[s+l],i[s+l],e.position-(r[s]-r[s+l]),f),a+=Wt.repeat(" ",t.indent)+Wx((e.line+l+1).toString(),c)+" | "+u.str+`
378
+ `;return a.replace(/\n$/,"")}var jEe=IEe,REe=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],NEe=["scalar","sequence","mapping"];function DEe(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function LEe(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(REe.indexOf(n)===-1)throw new Tn('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=DEe(t.styleAliases||null),NEe.indexOf(this.kind)===-1)throw new Tn('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var cn=LEe;function Yj(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(o,s){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=s)}),n[i]=r}),n}function $Ee(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Sk(e){return this.extend(e)}Sk.prototype.extend=function(t){var n=[],r=[];if(t instanceof cn)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Tn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof cn))throw new Tn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Tn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Tn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof cn))throw new Tn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Sk.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Yj(i,"implicit"),i.compiledExplicit=Yj(i,"explicit"),i.compiledTypeMap=$Ee(i.compiledImplicit,i.compiledExplicit),i};var $5=Sk,B5=new cn("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),F5=new cn("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),z5=new cn("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),W5=new $5({explicit:[B5,F5,z5]});function BEe(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function FEe(){return null}function zEe(e){return e===null}var U5=new cn("tag:yaml.org,2002:null",{kind:"scalar",resolve:BEe,construct:FEe,predicate:zEe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function WEe(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function UEe(e){return e==="true"||e==="True"||e==="TRUE"}function HEe(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var H5=new cn("tag:yaml.org,2002:bool",{kind:"scalar",resolve:WEe,construct:UEe,predicate:HEe,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function VEe(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function qEe(e){return 48<=e&&e<=55}function KEe(e){return 48<=e&&e<=57}function GEe(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!VEe(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!qEe(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!KEe(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function QEe(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function XEe(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Wt.isNegativeZero(e)}var V5=new cn("tag:yaml.org,2002:int",{kind:"scalar",resolve:GEe,construct:QEe,predicate:XEe,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YEe=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ZEe(e){return!(e===null||!YEe.test(e)||e[e.length-1]==="_")}function JEe(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var eTe=/^[-+]?[0-9]+e/;function tTe(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Wt.isNegativeZero(e))return"-0.0";return n=e.toString(10),eTe.test(n)?n.replace("e",".e"):n}function nTe(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Wt.isNegativeZero(e))}var q5=new cn("tag:yaml.org,2002:float",{kind:"scalar",resolve:ZEe,construct:JEe,predicate:nTe,represent:tTe,defaultStyle:"lowercase"}),K5=W5.extend({implicit:[U5,H5,V5,q5]}),G5=K5,Q5=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),X5=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function rTe(e){return e===null?!1:Q5.exec(e)!==null||X5.exec(e)!==null}function iTe(e){var t,n,r,i,o,s,a,l=0,u=null,c,f,h;if(t=Q5.exec(e),t===null&&(t=X5.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(c=+t[10],f=+(t[11]||0),u=(c*60+f)*6e4,t[9]==="-"&&(u=-u)),h=new Date(Date.UTC(n,r,i,o,s,a,l)),u&&h.setTime(h.getTime()-u),h}function oTe(e){return e.toISOString()}var Y5=new cn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:rTe,construct:iTe,instanceOf:Date,represent:oTe});function sTe(e){return e==="<<"||e===null}var Z5=new cn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:sTe}),aP=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
379
+ \r`;function aTe(e){if(e===null)return!1;var t,n,r=0,i=e.length,o=aP;for(n=0;n<i;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function lTe(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=aP,s=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function uTe(e){var t="",n=0,r,i,o=e.length,s=aP;for(r=0;r<o;r++)r%3===0&&r&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[r];return i=o%3,i===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):i===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):i===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function cTe(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var J5=new cn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:aTe,construct:lTe,predicate:cTe,represent:uTe}),fTe=Object.prototype.hasOwnProperty,hTe=Object.prototype.toString;function dTe(e){if(e===null)return!0;var t=[],n,r,i,o,s,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],s=!1,hTe.call(i)!=="[object Object]")return!1;for(o in i)if(fTe.call(i,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function pTe(e){return e!==null?e:[]}var e8=new cn("tag:yaml.org,2002:omap",{kind:"sequence",resolve:dTe,construct:pTe}),mTe=Object.prototype.toString;function gTe(e){if(e===null)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],mTe.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[t]=[i[0],r[i[0]]]}return!0}function yTe(e){if(e===null)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var t8=new cn("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:gTe,construct:yTe}),vTe=Object.prototype.hasOwnProperty;function bTe(e){if(e===null)return!0;var t,n=e;for(t in n)if(vTe.call(n,t)&&n[t]!==null)return!1;return!0}function xTe(e){return e!==null?e:{}}var n8=new cn("tag:yaml.org,2002:set",{kind:"mapping",resolve:bTe,construct:xTe}),lP=G5.extend({implicit:[Y5,Z5],explicit:[J5,e8,t8,n8]}),Ps=Object.prototype.hasOwnProperty,Fy=1,r8=2,i8=3,zy=4,Ux=1,wTe=2,Zj=3,STe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,kTe=/[\x85\u2028\u2029]/,OTe=/[,\[\]\{\}]/,o8=/^(?:!|!!|![a-z\-]+!)$/i,s8=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Jj(e){return Object.prototype.toString.call(e)}function Hi(e){return e===10||e===13}function Ia(e){return e===9||e===32}function qn(e){return e===9||e===32||e===10||e===13}function Zl(e){return e===44||e===91||e===93||e===123||e===125}function CTe(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ATe(e){return e===120?2:e===117?4:e===85?8:0}function PTe(e){return 48<=e&&e<=57?e-48:-1}function eR(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
380
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function ETe(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function a8(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var l8=new Array(256),u8=new Array(256);for(var Cl=0;Cl<256;Cl++)l8[Cl]=eR(Cl)?1:0,u8[Cl]=eR(Cl);function TTe(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||lP,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function c8(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=jEe(n),new Tn(t,n)}function ce(e,t){throw c8(e,t)}function Wy(e,t){e.onWarning&&e.onWarning.call(null,c8(e,t))}var tR={YAML:function(t,n,r){var i,o,s;t.version!==null&&ce(t,"duplication of %YAML directive"),r.length!==1&&ce(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&ce(t,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&ce(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&Wy(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,o;r.length!==2&&ce(t,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],o8.test(i)||ce(t,"ill-formed tag handle (first argument) of the TAG directive"),Ps.call(t.tagMap,i)&&ce(t,'there is a previously declared suffix for "'+i+'" tag handle'),s8.test(o)||ce(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{ce(t,"tag prefix is malformed: "+o)}t.tagMap[i]=o}};function ws(e,t,n,r){var i,o,s,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;i<o;i+=1)s=a.charCodeAt(i),s===9||32<=s&&s<=1114111||ce(e,"expected valid JSON character");else STe.test(a)&&ce(e,"the stream contains non-printable characters");e.result+=a}}function nR(e,t,n,r){var i,o,s,a;for(Wt.isObject(n)||ce(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),s=0,a=i.length;s<a;s+=1)o=i[s],Ps.call(t,o)||(a8(t,o,n[o]),r[o]=!0)}function Jl(e,t,n,r,i,o,s,a,l){var u,c;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,c=i.length;u<c;u+=1)Array.isArray(i[u])&&ce(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Jj(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Jj(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,c=o.length;u<c;u+=1)nR(e,t,o[u],n);else nR(e,t,o,n);else!e.json&&!Ps.call(n,i)&&Ps.call(t,i)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,ce(e,"duplicated mapping key")),a8(t,i,o),delete n[i];return t}function uP(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):ce(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Rt(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Ia(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Hi(i))for(uP(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Wy(e,"deficient indentation"),r}function V0(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||qn(n)))}function cP(e,t){t===1?e.result+=" ":t>1&&(e.result+=Wt.repeat(`
381
+ `,t-1))}function _Te(e,t,n){var r,i,o,s,a,l,u,c,f=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),qn(d)||Zl(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),qn(i)||n&&Zl(i)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),qn(i)||n&&Zl(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),qn(r))break}else{if(e.position===e.lineStart&&V0(e)||n&&Zl(d))break;if(Hi(d))if(l=e.line,u=e.lineStart,c=e.lineIndent,Rt(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=c;break}}a&&(ws(e,o,s,!1),cP(e,e.line-l),o=s=e.position,a=!1),Ia(d)||(s=e.position+1),d=e.input.charCodeAt(++e.position)}return ws(e,o,s,!1),e.result?!0:(e.kind=f,e.result=h,!1)}function MTe(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(ws(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Hi(n)?(ws(e,r,i,!0),cP(e,Rt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&V0(e)?ce(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);ce(e,"unexpected end of the stream within a single quoted scalar")}function ITe(e,t){var n,r,i,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return ws(e,n,e.position,!0),e.position++,!0;if(a===92){if(ws(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Hi(a))Rt(e,!1,t);else if(a<256&&l8[a])e.result+=u8[a],e.position++;else if((s=ATe(a))>0){for(i=s,o=0;i>0;i--)a=e.input.charCodeAt(++e.position),(s=CTe(a))>=0?o=(o<<4)+s:ce(e,"expected hexadecimal character");e.result+=ETe(o),e.position++}else ce(e,"unknown escape sequence");n=r=e.position}else Hi(a)?(ws(e,n,r,!0),cP(e,Rt(e,!1,t)),n=r=e.position):e.position===e.lineStart&&V0(e)?ce(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}ce(e,"unexpected end of the stream within a double quoted scalar")}function jTe(e,t){var n=!0,r,i,o,s=e.tag,a,l=e.anchor,u,c,f,h,d,p=Object.create(null),m,y,g,v;if(v=e.input.charCodeAt(e.position),v===91)c=93,d=!1,a=[];else if(v===123)c=125,d=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),v=e.input.charCodeAt(++e.position);v!==0;){if(Rt(e,!0,t),v=e.input.charCodeAt(e.position),v===c)return e.position++,e.tag=s,e.anchor=l,e.kind=d?"mapping":"sequence",e.result=a,!0;n?v===44&&ce(e,"expected the node content, but found ','"):ce(e,"missed comma between flow collection entries"),y=m=g=null,f=h=!1,v===63&&(u=e.input.charCodeAt(e.position+1),qn(u)&&(f=h=!0,e.position++,Rt(e,!0,t))),r=e.line,i=e.lineStart,o=e.position,lc(e,t,Fy,!1,!0),y=e.tag,m=e.result,Rt(e,!0,t),v=e.input.charCodeAt(e.position),(h||e.line===r)&&v===58&&(f=!0,v=e.input.charCodeAt(++e.position),Rt(e,!0,t),lc(e,t,Fy,!1,!0),g=e.result),d?Jl(e,a,p,y,m,g,r,i,o):f?a.push(Jl(e,null,p,y,m,g,r,i,o)):a.push(m),Rt(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}ce(e,"unexpected end of the stream within a flow collection")}function RTe(e,t){var n,r,i=Ux,o=!1,s=!1,a=t,l=0,u=!1,c,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Ux===i?i=f===43?Zj:wTe:ce(e,"repeat of a chomping mode identifier");else if((c=PTe(f))>=0)c===0?ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ce(e,"repeat of an indentation width identifier"):(a=t+c-1,s=!0);else break;if(Ia(f)){do f=e.input.charCodeAt(++e.position);while(Ia(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!Hi(f)&&f!==0)}for(;f!==0;){for(uP(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),Hi(f)){l++;continue}if(e.lineIndent<a){i===Zj?e.result+=Wt.repeat(`
382
+ `,o?1+l:l):i===Ux&&o&&(e.result+=`
383
+ `);break}for(r?Ia(f)?(u=!0,e.result+=Wt.repeat(`
384
+ `,o?1+l:l)):u?(u=!1,e.result+=Wt.repeat(`
385
+ `,l+1)):l===0?o&&(e.result+=" "):e.result+=Wt.repeat(`
386
+ `,l):e.result+=Wt.repeat(`
387
+ `,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!Hi(f)&&f!==0;)f=e.input.charCodeAt(++e.position);ws(e,n,e.position,!1)}return!0}function rR(e,t){var n,r=e.tag,i=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!qn(s))));){if(a=!0,e.position++,Rt(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,lc(e,t,i8,!1,!0),o.push(e.result),Rt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)ce(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function NTe(e,t,n){var r,i,o,s,a,l,u=e.tag,c=e.anchor,f={},h=Object.create(null),d=null,p=null,m=null,y=!1,g=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),v=e.input.charCodeAt(e.position);v!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(v===63||v===58)&&qn(r))v===63?(y&&(Jl(e,f,h,d,p,null,s,a,l),d=p=m=null),g=!0,y=!0,i=!0):y?(y=!1,i=!0):ce(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=r;else{if(s=e.line,a=e.lineStart,l=e.position,!lc(e,n,r8,!1,!0))break;if(e.line===o){for(v=e.input.charCodeAt(e.position);Ia(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),qn(v)||ce(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Jl(e,f,h,d,p,null,s,a,l),d=p=m=null),g=!0,y=!1,i=!1,d=e.tag,p=e.result;else if(g)ce(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=c,!0}else if(g)ce(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=c,!0}if((e.line===o||e.lineIndent>t)&&(y&&(s=e.line,a=e.lineStart,l=e.position),lc(e,t,zy,!0,i)&&(y?p=e.result:m=e.result),y||(Jl(e,f,h,d,p,m,s,a,l),d=p=m=null),Rt(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&v!==0)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Jl(e,f,h,d,p,null,s,a,l),g&&(e.tag=u,e.anchor=c,e.kind="mapping",e.result=f),g}function DTe(e){var t,n=!1,r=!1,i,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&ce(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(r=!0,i="!!",s=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):ce(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!qn(s);)s===33&&(r?ce(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),o8.test(i)||ce(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),OTe.test(o)&&ce(e,"tag suffix cannot contain flow indicator characters")}o&&!s8.test(o)&&ce(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{ce(e,"tag name is malformed: "+o)}return n?e.tag=o:Ps.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:ce(e,'undeclared tag handle "'+i+'"'),!0}function LTe(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&ce(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!qn(n)&&!Zl(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function $Te(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!qn(r)&&!Zl(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ps.call(e.anchorMap,n)||ce(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],Rt(e,!0,-1),!0}function lc(e,t,n,r,i){var o,s,a,l=1,u=!1,c=!1,f,h,d,p,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=zy===n||i8===n,r&&Rt(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;DTe(e)||LTe(e);)Rt(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=u||i),(l===1||zy===n)&&(Fy===n||r8===n?m=t:m=t+1,y=e.position-e.lineStart,l===1?a&&(rR(e,y)||NTe(e,y,m))||jTe(e,m)?c=!0:(s&&RTe(e,m)||MTe(e,m)||ITe(e,m)?c=!0:$Te(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&ce(e,"alias node should not have any properties")):_Te(e,m,Fy===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(c=a&&rR(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&ce(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,h=e.implicitTypes.length;f<h;f+=1)if(p=e.implicitTypes[f],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Ps.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,d=e.typeMap.multi[e.kind||"fallback"],f=0,h=d.length;f<h;f+=1)if(e.tag.slice(0,d[f].tag.length)===d[f].tag){p=d[f];break}p||ce(e,"unknown tag !<"+e.tag+">"),e.result!==null&&p.kind!==e.kind&&ce(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):ce(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function BTe(e){var t=e.position,n,r,i,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(Rt(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!qn(s);)s=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&ce(e,"directive name must not be less than one character in length");s!==0;){for(;Ia(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!Hi(s));break}if(Hi(s))break;for(n=e.position;s!==0&&!qn(s);)s=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}s!==0&&uP(e),Ps.call(tR,r)?tR[r](e,r,i):Wy(e,'unknown document directive "'+r+'"')}if(Rt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Rt(e,!0,-1)):o&&ce(e,"directives end mark is expected"),lc(e,e.lineIndent-1,zy,!1,!0),Rt(e,!0,-1),e.checkLineBreaks&&kTe.test(e.input.slice(t,e.position))&&Wy(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&V0(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Rt(e,!0,-1));return}if(e.position<e.length-1)ce(e,"end of the stream or a document separator is expected");else return}function f8(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
388
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new TTe(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,ce(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)BTe(n);return n.documents}function FTe(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=f8(e,n);if(typeof t!="function")return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])}function zTe(e,t){var n=f8(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Tn("expected a single document in the stream, but found more")}}var WTe=FTe,UTe=zTe,h8={loadAll:WTe,load:UTe},d8=Object.prototype.toString,p8=Object.prototype.hasOwnProperty,fP=65279,HTe=9,bd=10,VTe=13,qTe=32,KTe=33,GTe=34,kk=35,QTe=37,XTe=38,YTe=39,ZTe=42,m8=44,JTe=45,Uy=58,e_e=61,t_e=62,n_e=63,r_e=64,g8=91,y8=93,i_e=96,v8=123,o_e=124,b8=125,Sn={};Sn[0]="\\0";Sn[7]="\\a";Sn[8]="\\b";Sn[9]="\\t";Sn[10]="\\n";Sn[11]="\\v";Sn[12]="\\f";Sn[13]="\\r";Sn[27]="\\e";Sn[34]='\\"';Sn[92]="\\\\";Sn[133]="\\N";Sn[160]="\\_";Sn[8232]="\\L";Sn[8233]="\\P";var s_e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],a_e=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function l_e(e,t){var n,r,i,o,s,a,l;if(t===null)return{};for(n={},r=Object.keys(t),i=0,o=r.length;i<o;i+=1)s=r[i],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&p8.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function u_e(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Tn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Wt.repeat("0",r-t.length)+t}var c_e=1,xd=2;function f_e(e){this.schema=e.schema||lP,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Wt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=l_e(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?xd:c_e,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function iR(e,t){for(var n=Wt.repeat(" ",t),r=0,i=-1,o="",s,a=e.length;r<a;)i=e.indexOf(`
389
+ `,r),i===-1?(s=e.slice(r),r=a):(s=e.slice(r,i+1),r=i+1),s.length&&s!==`
390
+ `&&(o+=n),o+=s;return o}function Ok(e,t){return`
391
+ `+Wt.repeat(" ",e.indent*t)}function h_e(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Hy(e){return e===qTe||e===HTe}function wd(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==fP||65536<=e&&e<=1114111}function oR(e){return wd(e)&&e!==fP&&e!==VTe&&e!==bd}function sR(e,t,n){var r=oR(e),i=r&&!Hy(e);return(n?r:r&&e!==m8&&e!==g8&&e!==y8&&e!==v8&&e!==b8)&&e!==kk&&!(t===Uy&&!i)||oR(t)&&!Hy(t)&&e===kk||t===Uy&&i}function d_e(e){return wd(e)&&e!==fP&&!Hy(e)&&e!==JTe&&e!==n_e&&e!==Uy&&e!==m8&&e!==g8&&e!==y8&&e!==v8&&e!==b8&&e!==kk&&e!==XTe&&e!==ZTe&&e!==KTe&&e!==o_e&&e!==e_e&&e!==t_e&&e!==YTe&&e!==GTe&&e!==QTe&&e!==r_e&&e!==i_e}function p_e(e){return!Hy(e)&&e!==Uy}function Mf(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function x8(e){var t=/^\n* /;return t.test(e)}var w8=1,Ck=2,S8=3,k8=4,_l=5;function m_e(e,t,n,r,i,o,s,a){var l,u=0,c=null,f=!1,h=!1,d=r!==-1,p=-1,m=d_e(Mf(e,0))&&p_e(Mf(e,e.length-1));if(t||s)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=Mf(e,l),!wd(u))return _l;m=m&&sR(u,c,a),c=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=Mf(e,l),u===bd)f=!0,d&&(h=h||l-p-1>r&&e[p+1]!==" ",p=l);else if(!wd(u))return _l;m=m&&sR(u,c,a),c=u}h=h||d&&l-p-1>r&&e[p+1]!==" "}return!f&&!h?m&&!s&&!i(e)?w8:o===xd?_l:Ck:n>9&&x8(e)?_l:s?o===xd?_l:Ck:h?k8:S8}function g_e(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===xd?'""':"''";if(!e.noCompatMode&&(s_e.indexOf(t)!==-1||a_e.test(t)))return e.quotingType===xd?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=r||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return h_e(e,u)}switch(m_e(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!r,i)){case w8:return t;case Ck:return"'"+t.replace(/'/g,"''")+"'";case S8:return"|"+aR(t,e.indent)+lR(iR(t,o));case k8:return">"+aR(t,e.indent)+lR(iR(y_e(t,s),o));case _l:return'"'+v_e(t)+'"';default:throw new Tn("impossible error: invalid scalar style")}}()}function aR(e,t){var n=x8(e)?String(t):"",r=e[e.length-1]===`
392
+ `,i=r&&(e[e.length-2]===`
393
+ `||e===`
394
+ `),o=i?"+":r?"":"-";return n+o+`
395
+ `}function lR(e){return e[e.length-1]===`
396
+ `?e.slice(0,-1):e}function y_e(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var u=e.indexOf(`
397
+ `);return u=u!==-1?u:e.length,n.lastIndex=u,uR(e.slice(0,u),t)}(),i=e[0]===`
398
+ `||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",r+=a+(!i&&!o&&l!==""?`
399
+ `:"")+uR(l,t),i=o}return r}function uR(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,o,s=0,a=0,l="";r=n.exec(e);)a=r.index,a-i>t&&(o=s>i?s:a,l+=`
400
+ `+e.slice(i,o),i=o+1),s=a;return l+=`
401
+ `,e.length-i>t&&s>i?l+=e.slice(i,s)+`
402
+ `+e.slice(s+1):l+=e.slice(i),l.slice(1)}function v_e(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Mf(e,i),r=Sn[n],!r&&wd(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||u_e(n);return t}function b_e(e,t,n){var r="",i=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(To(e,t,a,!1,!1)||typeof a>"u"&&To(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function cR(e,t,n,r){var i="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(To(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&To(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Ok(e,t)),e.dump&&bd===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function x_e(e,t,n){var r="",i=e.tag,o=Object.keys(n),s,a,l,u,c;for(s=0,a=o.length;s<a;s+=1)c="",r!==""&&(c+=", "),e.condenseFlow&&(c+='"'),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),To(e,t,l,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),To(e,t,u,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function w_e(e,t,n,r){var i="",o=e.tag,s=Object.keys(n),a,l,u,c,f,h;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new Tn("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)h="",(!r||i!=="")&&(h+=Ok(e,t)),u=s[a],c=n[u],e.replacer&&(c=e.replacer.call(n,u,c)),To(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&bd===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,f&&(h+=Ok(e,t)),To(e,t+1,c,!0,f)&&(e.dump&&bd===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,i+=h));e.tag=o,e.dump=i||"{}"}function fR(e,t,n){var r,i,o,s,a,l;for(i=n?e.explicitTypes:e.implicitTypes,o=0,s=i.length;o<s;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,d8.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(p8.call(a.represent,l))r=a.represent[l](t,l);else throw new Tn("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function To(e,t,n,r,i,o,s){e.tag=null,e.dump=n,fR(e,n,!1)||fR(e,n,!0);var a=d8.call(e.dump),l=r,u;r&&(r=e.flowLevel<0||e.flowLevel>t);var c=a==="[object Object]"||a==="[object Array]",f,h;if(c&&(f=e.duplicates.indexOf(n),h=f!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(i=!1),h&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(c&&h&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(w_e(e,t,e.dump,i),h&&(e.dump="&ref_"+f+e.dump)):(x_e(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?cR(e,t-1,e.dump,i):cR(e,t,e.dump,i),h&&(e.dump="&ref_"+f+e.dump)):(b_e(e,t,e.dump),h&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&g_e(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Tn("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function S_e(e,t){var n=[],r=[],i,o;for(Ak(e,n,r),i=0,o=r.length;i<o;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(o)}function Ak(e,t,n){var r,i,o;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)Ak(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)Ak(e[r[i]],t,n)}function k_e(e,t){t=t||{};var n=new f_e(t);n.noRefs||S_e(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),To(n,0,r,!0,!0)?n.dump+`
403
+ `:""}var O_e=k_e,C_e={dump:O_e};function hP(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var A_e=cn,P_e=$5,E_e=W5,T_e=K5,__e=G5,M_e=lP,I_e=h8.load,j_e=h8.loadAll,R_e=C_e.dump,N_e=Tn,D_e={binary:J5,float:q5,map:z5,null:U5,pairs:t8,set:n8,timestamp:Y5,bool:H5,int:V5,merge:Z5,omap:e8,seq:F5,str:B5},L_e=hP("safeLoad","load"),$_e=hP("safeLoadAll","loadAll"),B_e=hP("safeDump","dump"),F_e={Type:A_e,Schema:P_e,FAILSAFE_SCHEMA:E_e,JSON_SCHEMA:T_e,CORE_SCHEMA:__e,DEFAULT_SCHEMA:M_e,load:I_e,loadAll:j_e,dump:R_e,YAMLException:N_e,types:D_e,safeLoad:L_e,safeLoadAll:$_e,safeDump:B_e};let Pk=[],O8=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?O8:Pk).push(n=n+e[t])})();function z_e(e){if(e<768)return!1;for(let t=0,n=Pk.length;;){let r=t+n>>1;if(e<Pk[r])n=r;else if(e>=O8[r])t=r+1;else return!0;if(t==n)return!1}}function hR(e){return e>=127462&&e<=127487}const dR=8205;function W_e(e,t,n=!0,r=!0){return(n?C8:U_e)(e,t,r)}function C8(e,t,n){if(t==e.length)return t;t&&A8(e.charCodeAt(t))&&P8(e.charCodeAt(t-1))&&t--;let r=Hx(e,t);for(t+=pR(r);t<e.length;){let i=Hx(e,t);if(r==dR||i==dR||n&&z_e(i))t+=pR(i),r=i;else if(hR(i)){let o=0,s=t-2;for(;s>=0&&hR(Hx(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function U_e(e,t,n){for(;t>0;){let r=C8(e,t-2,n);if(r<t)return r;t--}return 0}function Hx(e,t){let n=e.charCodeAt(t);if(!P8(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return A8(r)?(n-55296<<10)+(r-56320)+65536:n}function A8(e){return e>=56320&&e<57344}function P8(e){return e>=55296&&e<56320}function pR(e){return e<65536?1:2}class Me{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=uc(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Mi.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=uc(this,t,n);let r=[];return this.decompose(t,n,r,0),Mi.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new th(this),o=new th(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new th(this,t)}iterRange(t,n=this.length){return new E8(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new T8(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Me.empty:t.length<=32?new At(t):Mi.from(At.split(t,[]))}}class At extends Me{constructor(t,n=H_e(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new V_e(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new At(mR(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=Vm(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new At(a,s.length+o.length));else{let l=a.length>>1;r.push(new At(a.slice(0,l)),new At(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof At))return super.replace(t,n,r);[t,n]=uc(this,t,n);let i=Vm(this.text,Vm(r.text,mR(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new At(i,o):Mi.from(At.split(i,[]),o)}sliceString(t,n=this.length,r=`
404
+ `){[t,n]=uc(this,t,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>t&&s&&(i+=r),t<l&&n>o&&(i+=a.slice(Math.max(0,t-o),n-o)),o=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let o of t)r.push(o),i+=o.length+1,r.length==32&&(n.push(new At(r,i)),r=[],i=-1);return i>-1&&n.push(new At(r,i)),n}}class Mi extends Me{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=t)return s.lineInner(t,n,r,i);i=a+1,r=l+1}}decompose(t,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(t<=l&&n>=s){let u=i&((s<=t?1:0)|(l>=n?2:0));s>=t&&l<=n&&!u?r.push(a):a.decompose(t-s,n-s,r,u)}s=l+1}}replace(t,n,r){if([t,n]=uc(this,t,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(t>=o&&n<=a){let l=s.replace(t-o,n-o,r),u=this.lines-s.lines+l.lines;if(l.lines<u>>4&&l.lines>u>>6){let c=this.children.slice();return c[i]=l,new Mi(c,this.length-(n-t)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
405
+ `){[t,n]=uc(this,t,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let a=this.children[o],l=s+a.length;s>t&&o&&(i+=r),t<l&&n>s&&(i+=a.sliceString(t-s,n-s,r)),s=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Mi))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],u=t.children[o];if(l!=u)return r+l.scanIdentical(u,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of t)r+=d.lines;if(r<32){let d=[];for(let p of t)p.flatten(d);return new At(d,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,u=-1,c=[];function f(d){let p;if(d.lines>o&&d instanceof Mi)for(let m of d.children)f(m);else d.lines>s&&(l>s||!l)?(h(),a.push(d)):d instanceof At&&l&&(p=c[c.length-1])instanceof At&&d.lines+p.lines<=32?(l+=d.lines,u+=d.length+1,c[c.length-1]=new At(p.text.concat(d.text),p.length+1+d.length)):(l+d.lines>i&&h(),l+=d.lines,u+=d.length+1,c.push(d))}function h(){l!=0&&(a.push(c.length==1?c[0]:Mi.from(c,u)),u=-1,l=c.length=0)}for(let d of t)f(d);return h(),a.length==1?a[0]:new Mi(a,n)}}Me.empty=new At([""],0);function H_e(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Vm(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}function mR(e,t,n){return Vm(e,[""],t,n)}class th{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof At?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof At?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
406
+ `,this;t--}else if(i instanceof At){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[s+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof At?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class E8{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new th(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class T8{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Me.prototype[Symbol.iterator]=function(){return this.iter()},th.prototype[Symbol.iterator]=E8.prototype[Symbol.iterator]=T8.prototype[Symbol.iterator]=function(){return this});class V_e{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function uc(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Yt(e,t,n=!0,r=!0){return W_e(e,t,n,r)}function q_e(e){return e>=56320&&e<57344}function K_e(e){return e>=55296&&e<56320}function Fn(e,t){let n=e.charCodeAt(t);if(!K_e(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return q_e(r)?(n-55296<<10)+(r-56320)+65536:n}function dP(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Ii(e){return e<65536?1:2}const Ek=/\r\n?|\n/;var _n=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(_n||(_n={}));class Vi{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(t(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(t,n=!1){Tk(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new Vi(t)}composeDesc(t){return this.empty?t:t.empty?this:_8(this,t)}mapDesc(t,n=!1){return t.empty?this:_k(this,t,n)}mapPos(t,n=-1,r=_n.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],u=i+a;if(l<0){if(u>t)return o+(t-i);o+=a}else{if(r!=_n.Simple&&u>=t&&(r==_n.TrackDel&&i<t&&u>t||r==_n.TrackBefore&&i<t||r==_n.TrackAfter&&u>t))return null;if(u>t||u==t&&n<0&&!a)return t==i||n<0?o:o+l;o+=l}i=u}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return o}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],a=i+o;if(s>=0&&i<=n&&a>=t)return i<t&&a>n?"cover":!0;i=a}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Vi(t)}static create(t){return new Vi(t)}}class Bt extends Vi{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Tk(this,(n,r,i,o,s)=>t=t.replace(i,i+(r-n),s),!1),t}mapDesc(t,n=!1){return _k(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length<l;)r.push(Me.empty);r.push(s?t.slice(o,o+s):Me.empty)}o+=s}return new Bt(n,r)}compose(t){return this.empty?t:t.empty?this:_8(this,t,!0)}map(t,n=!1){return t.empty?this:_k(this,t,n,!0)}iterChanges(t,n=!1){Tk(this,t,n)}get desc(){return Vi.create(this.sections)}filter(t){let n=[],r=[],i=[],o=new Sd(this);e:for(let s=0,a=0;;){let l=s==t.length?1e9:t[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let c=Math.min(o.len,l-a);gn(i,c,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;gn(n,c,f),f>0&&ss(r,n,o.text),o.forward(c),a+=c}let u=t[s++];for(;a<u;){if(o.done)break e;let c=Math.min(o.len,u-a);gn(n,c,-1),gn(i,c,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(c),a+=c}}return{changes:new Bt(n,r),filtered:Vi.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],o=[],s=0,a=null;function l(c=!1){if(!c&&!i.length)return;s<n&&gn(i,n-s,-1);let f=new Bt(i,o);a=a?a.compose(f.map(a)):f,i=[],o=[],s=0}function u(c){if(Array.isArray(c))for(let f of c)u(f);else if(c instanceof Bt){if(c.length!=n)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${n})`);l(),a=a?a.compose(c.map(a)):c}else{let{from:f,to:h=f,insert:d}=c;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let p=d?typeof d=="string"?Me.of(d.split(r||Ek)):d:Me.empty,m=p.length;if(f==h&&m==0)return;f<s&&l(),f>s&&gn(i,f-s,-1),gn(i,h-f,m),ss(o,i,p),s=h}}return u(t),l(!a),a}static empty(t){return new Bt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let o=t[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(Me.empty);r[i]=Me.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new Bt(n,r)}static createSet(t,n){return new Bt(t,n)}}function gn(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function ss(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Me.empty);e.push(n)}}function Tk(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let u=i,c=o,f=Me.empty;for(;u+=a,c+=l,l&&r&&(f=f.append(r[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,u,o,c,f),i=u,o=c}}}function _k(e,t,n,r=!1){let i=[],o=r?[]:null,s=new Sd(e),a=new Sd(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let u=Math.min(s.len,a.len);gn(i,u,-1),s.forward(u),a.forward(u)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let u=a.len;for(gn(i,a.ins,-1);u;){let c=Math.min(s.len,u);s.ins>=0&&l<s.i&&s.len<=c&&(gn(i,0,s.ins),o&&ss(o,i,s.text),l=s.i),s.forward(c),u-=c}a.next()}else if(s.ins>=0){let u=0,c=s.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);u+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.len<c)c-=a.len,a.next();else break;gn(i,u,l<s.i?s.ins:0),o&&l<s.i&&ss(o,i,s.text),l=s.i,s.forward(s.len-c)}else{if(s.done&&a.done)return o?Bt.createSet(i,o):Vi.create(i);throw new Error("Mismatched change set lengths")}}}function _8(e,t,n=!1){let r=[],i=n?[]:null,o=new Sd(e),s=new Sd(t);for(let a=!1;;){if(o.done&&s.done)return i?Bt.createSet(r,i):Vi.create(r);if(o.ins==0)gn(r,o.len,0,a),o.next();else if(s.len==0&&!s.done)gn(r,0,s.ins,a),i&&ss(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),u=r.length;if(o.ins==-1){let c=s.ins==-1?-1:s.off?0:s.ins;gn(r,l,c,a),i&&c&&ss(i,r,s.text)}else s.ins==-1?(gn(r,o.off?0:o.len,l,a),i&&ss(i,r,o.textBit(l))):(gn(r,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&ss(i,r,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>u),o.forward2(l),s.forward(l)}}}}class Sd{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?Me.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Me.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class wa{constructor(t,n,r){this.from=t,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new wa(r,i,this.flags)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return V.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return V.range(this.anchor,i,void 0,void 0,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return V.range(t.anchor,t.head)}static create(t,n,r){return new wa(t,n,r)}}class V{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:V.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new V([this.main],0)}addRange(t,n=!0){return V.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,V.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new V(t.ranges.map(n=>wa.fromJSON(n)),t.main)}static single(t,n=t){return new V([V.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let o=t[i];if(o.empty?o.from<=r:o.from<r)return V.normalized(t.slice(),n);r=o.to}return new V(t,n)}static cursor(t,n=0,r,i){return wa.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(t,n,r,i,o){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!o&&t!=n&&(o=n<t?1:-1),n<t?wa.create(n,t,48|s):wa.create(t,n,(o?o<0?8:16:0)|s)}static normalized(t,n=0){let r=t[n];t.sort((i,o)=>i.from-o.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let o=t[i],s=t[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=n&&n--,t.splice(--i,2,o.anchor>o.head?V.range(l,a):V.range(a,l))}}return new V(t,n)}}function M8(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let pP=0;class se{constructor(t,n,r,i,o){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=pP++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new se(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:mP),!!t.static,t.enables)}of(t){return new qm([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new qm(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new qm(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function mP(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class qm{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=pP++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=t[o]>>1,a=this.type==2,l=!1,u=!1,c=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?u=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||c.push(t[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,h){if(l&&h.docChanged||u&&(h.docChanged||h.selection)||Mk(f,c)){let d=r(f);if(a?!gR(d,f.values[s],i):!i(d,f.values[s]))return f.values[s]=d,1}return 0},reconfigure:(f,h)=>{let d,p=h.config.address[o];if(p!=null){let m=qy(h,p);if(this.dependencies.every(y=>y instanceof se?h.facet(y)===f.facet(y):y instanceof kn?h.field(y,!1)==f.field(y,!1):!0)||(a?gR(d=r(f),m,i):i(d=r(f),m)))return f.values[s]=m,0}else d=r(f);return f.values[s]=d,1}}}}function gR(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Mk(e,t){let n=!1;for(let r of t)nh(e,r)&1&&(n=!0);return n}function G_e(e,t,n){let r=n.map(l=>e[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=e[t.id]>>1;function a(l){let u=[];for(let c=0;c<r.length;c++){let f=qy(l,r[c]);if(i[c]==2)for(let h of f)u.push(h);else u.push(f)}return t.combine(u)}return{create(l){for(let u of r)nh(l,u);return l.values[s]=a(l),1},update(l,u){if(!Mk(l,o))return 0;let c=a(l);return t.compare(c,l.values[s])?0:(l.values[s]=c,1)},reconfigure(l,u){let c=Mk(l,r),f=u.config.facets[t.id],h=u.facet(t);if(f&&!c&&mP(n,f))return l.values[s]=h,0;let d=a(l);return t.compare(d,h)?(l.values[s]=h,0):(l.values[s]=d,1)}}}const em=se.define({static:!0});class kn{constructor(t,n,r,i,o){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(t){let n=new kn(pP++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(em).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>{let o=r.facet(em),s=i.facet(em),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,em.of({field:this,create:t})]}get extension(){return this}}const la={lowest:4,low:3,default:2,high:1,highest:0};function vf(e){return t=>new I8(t,e)}const hl={highest:vf(la.highest),high:vf(la.high),default:vf(la.default),low:vf(la.low),lowest:vf(la.lowest)};class I8{constructor(t,n){this.inner=t,this.prec=n}}class q0{of(t){return new Ik(this,t)}reconfigure(t){return q0.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class Ik{constructor(t,n){this.compartment=t,this.inner=n}}class Vy{constructor(t,n,r,i,o,s){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],o=Object.create(null),s=new Map;for(let h of Q_e(t,n,s))h instanceof kn?i.push(h):(o[h.facet.id]||(o[h.facet.id]=[])).push(h);let a=Object.create(null),l=[],u=[];for(let h of i)a[h.id]=u.length<<1,u.push(d=>h.slot(d));let c=r?.config.facets;for(let h in o){let d=o[h],p=d[0].facet,m=c&&c[h]||[];if(d.every(y=>y.type==0))if(a[p.id]=l.length<<1|1,mP(m,d))l.push(r.facet(p));else{let y=p.combine(d.map(g=>g.value));l.push(r&&p.compare(y,r.facet(p))?r.facet(p):y)}else{for(let y of d)y.type==0?(a[y.id]=l.length<<1|1,l.push(y.value)):(a[y.id]=u.length<<1,u.push(g=>y.dynamicSlot(g)));a[p.id]=u.length<<1,u.push(y=>G_e(y,p,d))}}let f=u.map(h=>h(a));return new Vy(t,s,f,a,l,o)}}function Q_e(e,t,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let u=r[l].indexOf(s);u>-1&&r[l].splice(u,1),s instanceof Ik&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let u of s)o(u,a);else if(s instanceof Ik){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=t.get(s.compartment)||s.inner;n.set(s.compartment,u),o(u,a)}else if(s instanceof I8)o(s.inner,s.prec);else if(s instanceof kn)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof qm)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,la.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(u,a)}}return o(e,la.default),r.reduce((s,a)=>s.concat(a))}function nh(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function qy(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const j8=se.define(),jk=se.define({combine:e=>e.some(t=>t),static:!0}),R8=se.define({combine:e=>e.length?e[0]:void 0,static:!0}),N8=se.define(),D8=se.define(),L8=se.define(),$8=se.define({combine:e=>e.length?e[0]:!1});class Yi{constructor(t,n){this.type=t,this.value=n}static define(){return new X_e}}class X_e{of(t){return new Yi(this,t)}}class Y_e{constructor(t){this.map=t}of(t){return new ke(this,t)}}class ke{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new ke(this.type,n)}is(t){return this.type==t}static define(t={}){return new Y_e(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let o=i.map(n);o&&r.push(o)}return r}}ke.reconfigure=ke.define();ke.appendConfig=ke.define();class Vt{constructor(t,n,r,i,o,s){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&M8(r,n.newLength),o.some(a=>a.type==Vt.time)||(this.annotations=o.concat(Vt.time.of(Date.now())))}static create(t,n,r,i,o,s){return new Vt(t,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Vt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Vt.time=Yi.define();Vt.userEvent=Yi.define();Vt.addToHistory=Yi.define();Vt.remote=Yi.define();function Z_e(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else if(i<t.length)o=t[i++],s=t[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function B8(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=Bt.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:ke.mapEffects(e.effects,i).concat(ke.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Rk(e,t,n){let r=t.selection,i=vu(t.annotations);return t.userEvent&&(i=i.concat(Vt.userEvent.of(t.userEvent))),{changes:t.changes instanceof Bt?t.changes:Bt.of(t.changes||[],n,e.facet(R8)),selection:r&&(r instanceof V?r:V.single(r.anchor,r.head)),effects:vu(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function F8(e,t,n){let r=Rk(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let o=1;o<t.length;o++){t[o].filter===!1&&(n=!1);let s=!!t[o].sequential;r=B8(r,Rk(e,t[o],s?r.changes.newLength:e.doc.length),s)}let i=Vt.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return e2e(n?J_e(i):i)}function J_e(e){let t=e.startState,n=!0;for(let i of t.facet(N8)){let o=i(e);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:Z_e(n,o))}if(n!==!0){let i,o;if(n===!1)o=e.changes.invertedDesc,i=Bt.empty(t.doc.length);else{let s=e.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}e=Vt.create(t,i,e.selection&&e.selection.map(o),ke.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(D8);for(let i=r.length-1;i>=0;i--){let o=r[i](e);o instanceof Vt?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Vt?e=o[0]:e=F8(t,vu(o),!1)}return e}function e2e(e){let t=e.startState,n=t.facet(L8),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=B8(r,Rk(t,o,e.changes.newLength),!0))}return r==e?e:Vt.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const t2e=[];function vu(e){return e==null?t2e:Array.isArray(e)?e:[e]}var gt=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(gt||(gt={}));const n2e=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Nk;try{Nk=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function r2e(e){if(Nk)return Nk.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||n2e.test(n)))return!0}return!1}function i2e(e){return t=>{if(!/\S/.test(t))return gt.Space;if(r2e(t))return gt.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return gt.Word;return gt.Other}}class _e{constructor(t,n,r,i,o,s){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)nh(this,a<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return nh(this,r),qy(this,r)}update(...t){return F8(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let a of t.effects)a.is(q0.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,u)=>i.set(u,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(ke.reconfigure)?(n=null,r=a.value):a.is(ke.appendConfig)&&(n=null,r=vu(r).concat(a.value));let o;n?o=t.startState.values.slice():(n=Vy.resolve(r,i,this),o=new _e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let s=t.startState.facet(jk)?t.newSelection:t.newSelection.asSingle();new _e(n,t.newDoc,s,o,(a,l)=>l.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:V.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=vu(r.effects);for(let a=1;a<n.ranges.length;a++){let l=t(n.ranges[a]),u=this.changes(l.changes),c=u.map(i);for(let h=0;h<a;h++)o[h]=o[h].map(c);let f=i.mapDesc(u,!0);o.push(l.range.map(f)),i=i.compose(c),s=ke.mapEffects(s,c).concat(ke.mapEffects(vu(l.effects),f))}return{changes:i,selection:V.create(o,n.mainIndex),effects:s}}changes(t=[]){return t instanceof Bt?t:Bt.of(t,this.doc.length,this.facet(_e.lineSeparator))}toText(t){return Me.of(t.split(this.facet(_e.lineSeparator)||Ek))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(nh(this,n),qy(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof kn&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(t,o)){let s=r[o],a=t[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return _e.create({doc:t.doc,selection:V.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Vy.resolve(t.extensions||[],new Map),r=t.doc instanceof Me?t.doc:Me.of((t.doc||"").split(n.staticFacet(_e.lineSeparator)||Ek)),i=t.selection?t.selection instanceof V?t.selection:V.single(t.selection.anchor,t.selection.head):V.single(0);return M8(i,r.length),n.staticFacet(jk)||(i=i.asSingle()),new _e(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(_e.tabSize)}get lineBreak(){return this.facet(_e.lineSeparator)||`
407
+ `}get readOnly(){return this.facet($8)}phrase(t,...n){for(let r of this.facet(_e.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let o of this.facet(j8))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,t)&&i.push(s[t]);return i}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return i2e(n.length?n[0]:"")}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),o=this.charCategorizer(t),s=t-r,a=t-r;for(;s>0;){let l=Yt(n,s,!1);if(o(n.slice(l,s))!=gt.Word)break;s=l}for(;a<i;){let l=Yt(n,a);if(o(n.slice(a,l))!=gt.Word)break;a=l}return s==a?null:V.range(s+r,a+r)}}_e.allowMultipleSelections=jk;_e.tabSize=se.define({combine:e=>e.length?e[0]:4});_e.lineSeparator=R8;_e.readOnly=$8;_e.phrases=se.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});_e.languageData=j8;_e.changeFilter=N8;_e.transactionFilter=D8;_e.transactionExtender=L8;q0.reconfigure=ke.define();function Zi(e,t,n={}){let r={};for(let i of e)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class Es{eq(t){return this==t}range(t,n=t){return Dk.create(t,n,this)}}Es.prototype.startSide=Es.prototype.endSide=0;Es.prototype.point=!1;Es.prototype.mapMode=_n.TrackDel;function gP(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let Dk=class z8{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new z8(t,n,r)}};function Lk(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class yP{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,u=o[l]-t||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return u>=0?s:a;u>=0?a=l:s=l+1}}between(t,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+t,this.to[o]+t,this.value[o])===!1)return!1}map(t,n){let r=[],i=[],o=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let u=this.value[l],c=this.from[l]+t,f=this.to[l]+t,h,d;if(c==f){let p=n.mapPos(c,u.startSide,u.mapMode);if(p==null||(h=d=p,u.startSide!=u.endSide&&(d=n.mapPos(c,u.endSide),d<h)))continue}else if(h=n.mapPos(c,u.startSide),d=n.mapPos(f,u.endSide),h>d||h==d&&u.startSide>0&&u.endSide<=0)continue;(d-h||u.endSide-u.startSide)<0||(s<0&&(s=h),u.point&&(a=Math.max(a,d-h)),r.push(u),i.push(h-s),o.push(d-s))}return{mapped:r.length?new yP(i,o,r,a):null,pos:s}}}class Pe{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new Pe(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=t,s=t.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(Lk)),this.isEmpty)return n.length?Pe.of(n):this;let a=new W8(this,null,-1).goto(0),l=0,u=[],c=new _o;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let f=n[l++];c.addInner(f.from,f.to,f.value)||u.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||i>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||i>a.to||o<a.from||s(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||u.push(Dk.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!u.length?Pe.empty:this.nextLayer.update({add:u,filter:s,filterFrom:i,filterTo:o}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],u=t.touchesRange(a,a+l.length);if(u===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(t.mapPos(a));else if(u===!0){let{mapped:c,pos:f}=l.map(a,t);c&&(i=Math.max(i,c.maxPoint),n.push(c),r.push(f))}}let o=this.nextLayer.map(t);return n.length==0?o:new Pe(r,n,o||Pe.empty,i)}between(t,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&t<=o+s.length&&s.between(o,t-o,n-o,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return kd.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return kd.from(t).goto(n)}static compare(t,n,r,i,o=-1){let s=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=yR(s,a,r),u=new bf(s,l,o),c=new bf(a,l,o);r.iterGaps((f,h,d)=>vR(u,f,c,h,d,i)),r.empty&&r.length==0&&vR(u,0,c,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let o=t.filter(c=>!c.isEmpty&&n.indexOf(c)<0),s=n.filter(c=>!c.isEmpty&&t.indexOf(c)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=yR(o,s),l=new bf(o,a,0).goto(r),u=new bf(s,a,0).goto(r);for(;;){if(l.to!=u.to||!$k(l.active,u.active)||l.point&&(!u.point||!gP(l.point,u.point)))return!1;if(l.to>i)return!0;l.next(),u.next()}}static spans(t,n,r,i,o=-1){let s=new bf(t,null,o).goto(n),a=n,l=s.openStart;for(;;){let u=Math.min(s.to,r);if(s.point){let c=s.activeForPoint(s.to),f=s.pointFrom<n?c.length+1:s.point.startSide<0?c.length:Math.min(c.length,l);i.point(a,u,s.point,c,f,s.pointRank),l=Math.min(s.openEnd(u),c.length)}else u>a&&(i.span(a,u,s.active,l),l=s.openEnd(u));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(t,n=!1){let r=new _o;for(let i of t instanceof Dk?[t]:n?o2e(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return Pe.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=Pe.empty;i=i.nextLayer)n=new Pe(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Pe.empty=new Pe([],[],null,-1);function o2e(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(Lk(t,r)>0)return e.slice().sort(Lk);t=r}return e}Pe.empty.nextLayer=Pe.empty;class _o{finishChunk(t){this.chunks.push(new yP(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new _o)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(Pe.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Pe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function yR(e,t,n){let r=new Map;for(let o of e)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of t)for(let s=0;s<o.chunk.length;s++){let a=r.get(o.chunk[s]);a!=null&&(n?n.mapPos(a):a)==o.chunkPos[s]&&!n?.touchesRange(a,a+o.chunk[s].length)&&i.add(o.chunk[s])}return i}class W8{constructor(t,n,r,i=0){this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}gotoInner(t,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,n){(this.to-t||this.endSide-n)<0&&this.gotoInner(t,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=t+n.from[this.rangeIndex];if(this.from=r,this.to=t+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class kd{constructor(t){this.heap=t}static from(t,n=null,r=-1){let i=[];for(let o=0;o<t.length;o++)for(let s=t[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new W8(s,n,r,o));return i.length==1?i[0]:new kd(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)Vx(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)Vx(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Vx(this.heap,0)}}}function Vx(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class bf{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=kd.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){tm(this.active,t),tm(this.activeTo,t),tm(this.activeRank,t),this.minActive=bR(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;nm(this.active,n,r),nm(this.activeTo,n,i),nm(this.activeRank,n,o),t&&nm(t,n,this.cursor.from),this.minActive=bR(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&tm(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function vR(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t,u=!!o.boundChange;for(let c=!1;;){let f=e.to+l-n.to,h=f||e.endSide-n.endSide,d=h<0?e.to+l:n.to,p=Math.min(d,s);if(e.point||n.point?(e.point&&n.point&&gP(e.point,n.point)&&$k(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,p,e.point,n.point),c=!1):(c&&o.boundChange(a),p>a&&!$k(e.active,n.active)&&o.compareRange(a,p,e.active,n.active),u&&p<s&&(f||e.openEnd(d)!=n.openEnd(d))&&(c=!0)),d>s)break;a=d,h<=0&&e.next(),h>=0&&n.next()}}function $k(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!gP(e[n],t[n]))return!1;return!0}function tm(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function nm(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function bR(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function Bc(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=Yt(e,i));return r}function Bk(e,t,n,r){for(let i=0,o=0;;){if(o>=t)return i;if(i==e.length)break;o+=e.charCodeAt(i)==9?n-o%n:1,i=Yt(e,i)}return r===!0?-1:e.length}const Fk="ͼ",xR=typeof Symbol>"u"?"__"+Fk:Symbol.for(Fk),zk=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),wR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ts{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,u){let c=[],f=/^@(\w+)\b/.exec(s[0]),h=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let d in a){let p=a[d];if(/&/.test(d))o(d.split(/,\s*/).map(m=>s.map(y=>m.replace(/&/,y))).reduce((m,y)=>m.concat(y)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");o(i(d),p,c,h)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||h)&&l.push((r&&!f&&!u?s.map(r):s).join(", ")+" {"+c.join(" ")+"}")}for(let s in t)o(i(s),t[s],this.rules)}getRules(){return this.rules.join(`
408
+ `)}static newName(){let t=wR[xR]||1;return wR[xR]=t+1,Fk+t.toString(36)}static mount(t,n,r){let i=t[zk],o=r&&r.nonce;i?o&&i.setNonce(o):i=new s2e(t,o),i.mount(Array.isArray(n)?n:[n],t)}}let SR=new Map;class s2e{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let o=SR.get(r);if(o)return t[zk]=o;this.sheet=new i.CSSStyleSheet,SR.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[zk]=this}mount(t,n){let r=this.sheet,i=0,o=0;for(let s=0;s<t.length;s++){let a=t[s],l=this.modules.indexOf(a);if(l<o&&l>-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let u=0;u<a.rules.length;u++)r.insertRule(a.rules[u],i++)}else{for(;o<l;)i+=this.modules[o++].rules.length;i+=a.rules.length,o++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
409
+ `;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var _s={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Od={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a2e=typeof navigator<"u"&&/Mac/.test(navigator.platform),l2e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)_s[48+an]=_s[96+an]=String(an);for(var an=1;an<=24;an++)_s[an+111]="F"+an;for(var an=65;an<=90;an++)_s[an]=String.fromCharCode(an+32),Od[an]=String.fromCharCode(an);for(var qx in _s)Od.hasOwnProperty(qx)||(Od[qx]=_s[qx]);function u2e(e){var t=a2e&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||l2e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Od:_s)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function Ue(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)U8(e,arguments[t]);return e}function U8(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)U8(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}let En=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Wk=typeof document<"u"?document:{documentElement:{style:{}}};const Uk=/Edge\/(\d+)/.exec(En.userAgent),H8=/MSIE \d/.test(En.userAgent),Hk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(En.userAgent),K0=!!(H8||Hk||Uk),kR=!K0&&/gecko\/(\d+)/i.test(En.userAgent),Kx=!K0&&/Chrome\/(\d+)/.exec(En.userAgent),OR="webkitFontSmoothing"in Wk.documentElement.style,Vk=!K0&&/Apple Computer/.test(En.vendor),CR=Vk&&(/Mobile\/\w+/.test(En.userAgent)||En.maxTouchPoints>2);var oe={mac:CR||/Mac/.test(En.platform),windows:/Win/.test(En.platform),linux:/Linux|X11/.test(En.platform),ie:K0,ie_version:H8?Wk.documentMode||6:Hk?+Hk[1]:Uk?+Uk[1]:0,gecko:kR,gecko_version:kR?+(/Firefox\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,chrome:!!Kx,chrome_version:Kx?+Kx[1]:0,ios:CR,android:/Android\b/.test(En.userAgent),webkit:OR,webkit_version:OR?+(/\bAppleWebKit\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,safari:Vk,safari_version:Vk?+(/\bVersion\/(\d+(\.\d+)?)/.exec(En.userAgent)||[0,0])[1]:0,tabSize:Wk.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function vP(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const Ky=Object.create(null);function bP(e,t,n){if(e==t)return!0;e||(e=Ky),t||(t=Ky);let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||e[o]!==t[o]))return!1;return!0}function c2e(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]==null&&e.removeAttribute(r)}for(let n in t){let r=t[n];n=="style"?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function AR(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function f2e(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class Ji{eq(t){return!1}updateDOM(t,n,r){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var fn=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(fn||(fn={}));class he extends Es{constructor(t,n,r,i){super(),this.startSide=t,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(t){return new ip(t)}static widget(t){let n=Math.max(-1e4,Math.min(1e4,t.side||0)),r=!!t.block;return n+=r&&!t.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Xa(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=V8(t,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Xa(t,r,i,n,t.widget||null,!0)}static line(t){return new op(t)}static set(t,n=!1){return Pe.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}he.none=Pe.empty;class ip extends he{constructor(t){let{start:n,end:r}=V8(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?vP(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||Ky}eq(t){return this==t||t instanceof ip&&this.tagName==t.tagName&&bP(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}ip.prototype.point=!1;class op extends he{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof op&&this.spec.class==t.spec.class&&bP(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}op.prototype.mapMode=_n.TrackBefore;op.prototype.point=!0;class Xa extends he{constructor(t,n,r,i,o,s){super(n,r,o,t),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?_n.TrackBefore:_n.TrackAfter:_n.TrackDel}get type(){return this.startSide!=this.endSide?fn.WidgetRange:this.startSide<=0?fn.WidgetBefore:fn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Xa&&h2e(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}Xa.prototype.point=!0;function V8(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function h2e(e,t){return e==t||!!(e&&t&&e.compare(t))}function bu(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class Cd extends Es{constructor(t,n){super(),this.tagName=t,this.attributes=n}eq(t){return t==this||t instanceof Cd&&this.tagName==t.tagName&&bP(this.attributes,t.attributes)}static create(t){return new Cd(t.tagName,t.attributes||Ky)}static set(t,n=!1){return Pe.of(t,n)}}Cd.prototype.startSide=Cd.prototype.endSide=-1;function Ad(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function qk(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function rh(e,t){if(!t.anchorNode)return!1;try{return qk(e,t.anchorNode)}catch{return!1}}function ih(e){return e.nodeType==3?Ed(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function oh(e,t,n,r){return n?PR(e,t,n,r,-1)||PR(e,t,n,r,1):!1}function Ms(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function Gy(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function PR(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Mo(e))){if(e.nodeName=="DIV")return!1;let o=e.parentNode;if(!o||o.nodeType!=1)return!1;t=Ms(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?Mo(e):0}else return!1}}function Mo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Pd(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function d2e(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function q8(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function p2e(e,t,n,r,i,o,s,a){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,f=!1;c&&!f;)if(c.nodeType==1){let h,d=c==l.body,p=1,m=1;if(d)h=d2e(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let v=c.getBoundingClientRect();({scaleX:p,scaleY:m}=q8(c,v)),h={left:v.left,right:v.left+c.clientWidth*p,top:v.top,bottom:v.top+c.clientHeight*m}}let y=0,g=0;if(i=="nearest")t.top<h.top+s?(g=t.top-(h.top+s),n>0&&t.bottom>h.bottom+g&&(g=t.bottom-h.bottom+s)):t.bottom>h.bottom-s&&(g=t.bottom-h.bottom+s,n<0&&t.top-g<h.top&&(g=t.top-(h.top+s)));else{let v=t.bottom-t.top,x=h.bottom-h.top;g=(i=="center"&&v<=x?t.top+v/2-x/2:i=="start"||i=="center"&&n<0?t.top-s:t.bottom-x+s)-h.top}if(r=="nearest"?t.left<h.left+o?(y=t.left-(h.left+o),n>0&&t.right>h.right+y&&(y=t.right-h.right+o)):t.right>h.right-o&&(y=t.right-h.right+o,n<0&&t.left<h.left+y&&(y=t.left-(h.left+o))):y=(r=="center"?t.left+(t.right-t.left)/2-(h.right-h.left)/2:r=="start"==a?t.left-o:t.right-(h.right-h.left)+o)-h.left,y||g)if(d)u.scrollBy(y,g);else{let v=0,x=0;if(g){let k=c.scrollTop;c.scrollTop+=g/m,x=(c.scrollTop-k)*m}if(y){let k=c.scrollLeft;c.scrollLeft+=y/p,v=(c.scrollLeft-k)*p}t={left:t.left-v,top:t.top-x,right:t.right-v,bottom:t.bottom-x},v&&Math.abs(v-y)<1&&(r="nearest"),x&&Math.abs(x-g)<1&&(i="nearest")}if(d)break;(t.top<h.top||t.bottom>h.bottom||t.left<h.left||t.right>h.right)&&(t={left:Math.max(t.left,h.left),right:Math.min(t.right,h.right),top:Math.max(t.top,h.top),bottom:Math.min(t.bottom,h.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function K8(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let o=e.parentNode;o&&!(o==n.body||(!t||r)&&i);)if(o.nodeType==1)!i&&o.scrollHeight>o.clientHeight&&(i=o),t&&!r&&o.scrollWidth>o.clientWidth&&(r=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:r,y:i}}class m2e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?Mo(n):0),r,Math.min(t.focusOffset,r?Mo(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let oa=null;oe.safari&&oe.safari_version>=26&&(oa=!1);function G8(e){if(e.setActive)return e.setActive();if(oa)return e.focus(oa);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(oa==null?{get preventScroll(){return oa={preventScroll:!0},!0}}:void 0),!oa){oa=!1;for(let n=0;n<t.length;){let r=t[n++],i=t[n++],o=t[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let ER;function Ed(e,t,n=t){let r=ER||(ER=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function xu(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function g2e(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function y2e(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Mo(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Mo(n))}else{if(n==e)return!0;r=Ms(n),n=n.parentNode}}function Q8(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function X8(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Mo(n)}else if(n.parentNode&&!Gy(n))r=Ms(n),n=n.parentNode;else return null}}function Y8(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Gy(n))r=Ms(n)+1,n=n.parentNode;else return null}}class ui{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new ui(t.parentNode,Ms(t),n)}static after(t,n){return new ui(t.parentNode,Ms(t)+1,n)}}var Ye=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Ye||(Ye={}));const Ya=Ye.LTR,xP=Ye.RTL;function Z8(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const v2e=Z8("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),b2e=Z8("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Kk=Object.create(null),wi=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Kk[t]=n,Kk[n]=-t}function J8(e){return e<=247?v2e[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?b2e[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const x2e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ni{get dir(){return this.level%2?xP:Ya}constructor(t,n,r){this.from=t,this.to=n,this.level=r}side(t,n){return this.dir==n==t?this.to:this.from}forward(t,n){return t==(this.dir==n)}static find(t,n,r,i){let o=-1;for(let s=0;s<t.length;s++){let a=t[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.from<n:a.to>n:t[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function e6(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!e6(r.inner,i.inner))return!1}return!0}const Qe=[];function w2e(e,t,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:t,a=o<r.length?r[o].from:n,l=o?256:i;for(let u=s,c=l,f=l;u<a;u++){let h=J8(e.charCodeAt(u));h==512?h=c:h==8&&f==4&&(h=16),Qe[u]=h==4?2:h,h&7&&(f=h),c=h}for(let u=s,c=l,f=l;u<a;u++){let h=Qe[u];if(h==128)u<a-1&&c==Qe[u+1]&&c&24?h=Qe[u]=c:Qe[u]=256;else if(h==64){let d=u+1;for(;d<a&&Qe[d]==64;)d++;let p=u&&c==8||d<n&&Qe[d]==8?f==1?1:8:256;for(let m=u;m<d;m++)Qe[m]=p;u=d-1}else h==8&&f==1&&(Qe[u]=1);c=h,h&7&&(f=h)}}}function S2e(e,t,n,r,i){let o=i==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let u=s?r[s-1].to:t,c=s<r.length?r[s].from:n;for(let f=u,h,d,p;f<c;f++)if(d=Kk[h=e.charCodeAt(f)])if(d<0){for(let m=a-3;m>=0;m-=3)if(wi[m+1]==-d){let y=wi[m+2],g=y&2?i:y&4?y&1?o:i:0;g&&(Qe[f]=Qe[wi[m]]=g),a=m;break}}else{if(wi.length==189)break;wi[a++]=f,wi[a++]=h,wi[a++]=l}else if((p=Qe[f])==2||p==1){let m=p==i;l=m?0:1;for(let y=a-3;y>=0;y-=3){let g=wi[y+2];if(g&2)break;if(m)wi[y+2]|=2;else{if(g&4)break;wi[y+2]|=4}}}}}function k2e(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=i<n.length?n[i].from:t;for(let l=s;l<a;){let u=Qe[l];if(u==256){let c=l+1;for(;;)if(c==a){if(i==n.length)break;c=n[i++].to,a=i<n.length?n[i].from:t}else if(Qe[c]==256)c++;else break;let f=o==1,h=(c<t?Qe[c]:r)==1,d=f==h?f?1:2:r;for(let p=c,m=i,y=m?n[m-1].to:e;p>l;)p==y&&(p=n[--m].from,y=m?n[m-1].to:e),Qe[--p]=d;l=c}else o=u,l++}}}function Gk(e,t,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=t,u=0;l<n;){let c=!0,f=!1;if(u==o.length||l<o[u].from){let m=Qe[l];m!=a&&(c=!1,f=m==16)}let h=!c&&a==1?[]:null,d=c?r:r+1,p=l;e:for(;;)if(u<o.length&&p==o[u].from){if(f)break e;let m=o[u];if(!c)for(let y=m.to,g=u+1;;){if(y==n)break e;if(g<o.length&&o[g].from==y)y=o[g++].to;else{if(Qe[y]==a)break e;break}}if(u++,h)h.push(m);else{m.from>l&&s.push(new Ni(l,m.from,d));let y=m.direction==Ya!=!(d%2);Qk(e,y?r+1:r,i,m.inner,m.from,m.to,s),l=m.to}p=m.to}else{if(p==n||(c?Qe[p]!=a:Qe[p]==a))break;p++}h?Gk(e,l,p,r+1,i,h,s):l<p&&s.push(new Ni(l,p,d)),l=p}else for(let l=n,u=o.length;l>t;){let c=!0,f=!1;if(!u||l>o[u-1].to){let m=Qe[l-1];m!=a&&(c=!1,f=m==16)}let h=!c&&a==1?[]:null,d=c?r:r+1,p=l;e:for(;;)if(u&&p==o[u-1].to){if(f)break e;let m=o[--u];if(!c)for(let y=m.from,g=u;;){if(y==t)break e;if(g&&o[g-1].to==y)y=o[--g].from;else{if(Qe[y-1]==a)break e;break}}if(h)h.push(m);else{m.to<l&&s.push(new Ni(m.to,l,d));let y=m.direction==Ya!=!(d%2);Qk(e,y?r+1:r,i,m.inner,m.from,m.to,s),l=m.from}p=m.from}else{if(p==t||(c?Qe[p-1]!=a:Qe[p-1]==a))break;p--}h?Gk(e,p,l,r+1,i,h,s):p<l&&s.push(new Ni(p,l,d)),l=p}}function Qk(e,t,n,r,i,o,s){let a=t%2?2:1;w2e(e,i,o,r,a),S2e(e,i,o,r,a),k2e(i,o,r,a),Gk(e,i,o,t,n,r,s)}function O2e(e,t,n){if(!e)return[new Ni(0,0,t==xP?1:0)];if(t==Ya&&!n.length&&!x2e.test(e))return t6(e.length);if(n.length)for(;e.length>Qe.length;)Qe[Qe.length]=256;let r=[],i=t==Ya?0:1;return Qk(e,i,i,n,0,e.length,r),r}function t6(e){return[new Ni(0,e,0)]}let n6="";function C2e(e,t,n,r,i){var o;let s=r.head-e.from,a=Ni.find(t,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=t[a],u=l.side(i,n);if(s==u){let h=a+=i?1:-1;if(h<0||h>=t.length)return null;l=t[a=h],s=l.side(!i,n),u=l.side(i,n)}let c=Yt(e.text,s,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),n6=e.text.slice(Math.min(s,c),Math.max(s,c));let f=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return f&&c==u&&f.level+(i?0:1)<l.level?V.cursor(f.side(!i,n)+e.from,f.forward(i,n)?1:-1,f.level):V.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}function A2e(e,t,n){for(let r=t;r<n;r++){let i=J8(e.charCodeAt(r));if(i==1)return Ya;if(i==2||i==4)return xP}return Ya}const r6=se.define(),i6=se.define(),o6=se.define(),s6=se.define(),Xk=se.define(),a6=se.define(),l6=se.define(),wP=se.define(),SP=se.define(),u6=se.define({combine:e=>e.some(t=>t)}),c6=se.define({combine:e=>e.some(t=>t)}),f6=se.define();class wu{constructor(t,n,r,i,o,s=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(t){return t.empty?this:new wu(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new wu(V.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const rm=ke.define({map:(e,t)=>e.map(t)}),h6=ke.define();function Kn(e,t,n){let r=e.facet(s6);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const lo=se.define({combine:e=>e.length?e[0]:!0});let P2e=0;const eu=se.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}});class Ot{constructor(t,n,r,i,o){this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(eu.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(eu.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Ot(P2e++,t,r,i,a=>{let l=[];return s&&l.push(G0.of(u=>{let c=u.plugin(a);return c?s(c):he.none})),o&&l.push(o(a)),l})}static fromClass(t,n){return Ot.define((r,i)=>new t(r,i),n)}}class Gx{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Kn(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){Kn(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Kn(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const d6=se.define(),kP=se.define(),G0=se.define(),p6=se.define(),OP=se.define(),sp=se.define(),m6=se.define();function TR(e,t){let n=e.state.facet(m6);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(e):o),i=[];return Pe.spans(r,t.from,t.to,{point(){},span(o,s,a,l){let u=o-t.from,c=s-t.from,f=i;for(let h=a.length-1;h>=0;h--,l--){let d=a[h].spec.bidiIsolate,p;if(d==null&&(d=A2e(t.text,u,c)),l>0&&f.length&&(p=f[f.length-1]).to==u&&p.direction==d)p.to=c,f=p.inner;else{let m={from:u,to:c,direction:d,inner:[]};f.push(m),f=m.inner}}}}),i}const g6=se.define();function CP(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(g6)){let s=o(e);s&&(s.left!=null&&(t=Math.max(t,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}const If=se.define();class Fr{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new Fr(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),t.splice(n-1,1)}}return t.splice(n,0,r),t}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,o=0,s=0;;){let a=i<t.length?t[i].fromB:1e9,l=o<n.length?n[o]:1e9,u=Math.min(a,l);if(u==1e9)break;let c=u+s,f=u,h=c;for(;;)if(o<n.length&&n[o]<=f){let d=n[o+1];o+=2,f=Math.max(f,d);for(let p=i;p<t.length&&t[p].fromB<=f;p++)s=t[p].toA-t[p].toB;h=Math.max(h,d+s)}else if(i<t.length&&t[i].fromB<=f){let d=t[i++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),s=d.toA-d.toB}else break;r.push(new Fr(c,h,u,f))}return r}}class Qy{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Bt.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new Fr(o,s,a,l))),this.changedRanges=i}static create(t,n,r){return new Qy(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const E2e=[];class kt{constructor(t,n,r=0){this.dom=t,this.length=n,this.flags=r,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return E2e}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&c2e(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let r=n;for(let i of this.children){if(i==t)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n){return null}domPosFor(t,n){let r=Ms(this.dom),i=this.length?t>0:n>0;return new ui(this.parent.dom,r+(i?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof X0)return t;return null}static get(t){return t.cmTile}}class Q0 extends kt{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,r=null,i,o=t?.node==n?t:null,s=0;for(let a of this.children){if(a.sync(t),s+=a.length+a.breakAfter,i=r?r.nextSibling:n.firstChild,o&&i!=a.dom&&(o.written=!0),a.dom.parentNode==n)for(;i&&i!=a.dom;)i=_R(i);else n.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:n.firstChild,o&&i&&(o.written=!0);i;)i=_R(i);this.length=s}}function _R(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class X0 extends Q0{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=kt.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],r=this,i=0,o=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&o++,i=n.pop()}else{let s=r.children[i++];if(s instanceof wo)n.push(i),r=s,i=0;else{let a=o+s.length,l=t(s,o);if(l!==void 0)return l;o=a+s.breakAfter}}}resolveBlock(t,n){let r,i=-1,o,s=-1;if(this.blockTiles((a,l)=>{let u=l+a.length;if(t>=l&&t<=u){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(l<t||t==u&&(n<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=t-l),(u>t||t==l&&(n>1?a.length:a.covers(-1)))&&(!o||!a.isWidget()&&o.isWidget())&&(o=a,s=t-l)}}),!r&&!o)throw new Error("No tile at position "+t);return r&&n<0||!o?{tile:r,offset:i}:{tile:o,offset:s}}}class wo extends Q0{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new wo(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class cc extends Q0{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new cc(n||document.createElement("div"),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(t,n,r){let i=null,o=-1,s=null,a=-1;function l(c,f){for(let h=0,d=0;h<c.children.length&&d<=f;h++){let p=c.children[h],m=d+p.length;m>=f&&(p.isComposite()?l(p,f-d):(!s||s.isHidden&&(n>0||r&&_2e(s,p)))&&(m>f||p.flags&32)?(s=p,a=f-d):(d<f||p.flags&16&&!p.isHidden)&&(i=p,o=f-d)),d=m}}l(this,t);let u=(n<0?i:s)||i||s;return u?{tile:u,offset:u==i?o:a}:null}coordsIn(t,n){let r=this.resolveInline(t,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):T2e(this)}domIn(t,n){let r=this.resolveInline(t,n);if(r){let{tile:i,offset:o}=r;if(this.dom.contains(i.dom))return i.isText()?new ui(i.dom,Math.min(i.dom.nodeValue.length,o)):i.domPosFor(o,i.flags&16?1:i.flags&32?-1:n);let s=r.tile.parent,a=!1;for(let l of s.children){if(a)return new ui(l.dom,0);l==r.tile&&(a=!0)}}return new ui(this.dom,0)}}function T2e(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=ih(t);return n[n.length-1]||null}function _2e(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Wn extends Q0{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new Wn(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Sa extends kt{constructor(t,n){super(t,n.length),this.text=n}sync(t){this.flags&2||(super.sync(t),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(t,n){let r=this.dom.nodeValue.length;t>r&&(t=r);let i=t,o=t,s=0;t==0&&n<0||t==r&&n>=0?oe.chrome||oe.gecko||(t?(i--,s=1):o<r&&(o++,s=-1)):n<0?i--:o<r&&o++;let a=Ed(this.dom,i,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return oe.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,u=>u.width)||l),s?Pd(l,s<0):l||null}static of(t,n){let r=new Sa(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class Za extends kt{constructor(t,n,r,i){super(t,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,r){let i=this.widget.coordsAt(this.dom,t,n);if(i)return i;if(r)return Pd(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let o=this.dom.getClientRects(),s=null;if(!o.length)return null;let a=this.flags&16?!0:this.flags&32?!1:t>0;for(let l=a?o.length-1:0;s=o[l],!(t>0?l==0:l==o.length-1||s.top<s.bottom);l+=a?-1:1);return Pd(s,!a)}}get overrideDOMText(){if(!this.length)return Me.empty;let{root:t}=this;if(!t)return Me.empty;let n=this.posAtStart;return t.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,o){return o||(o=t.toDOM(n),t.editable||(o.contentEditable="false")),new Za(o,r,t,i)}}class Xy extends kt{constructor(t){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,t)}get isHidden(){return!0}get overrideDOMText(){return Me.empty}coordsIn(t){return this.dom.getBoundingClientRect()}}class M2e{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,r){let{tile:i,index:o,beforeBreak:s,parents:a}=this;for(;t||n>0;)if(i.isComposite())if(s){if(!t)break;r&&r.break(),t--,s=!1}else if(o==i.children.length){if(!t&&!a.length)break;r&&r.leave(i),s=!!i.breakAfter,{tile:i,index:o}=a.pop(),o++}else{let l=i.children[o],u=l.breakAfter;(n>0?l.length<=t:l.length<t)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(s=!!u,o++,t-=l.length):(a.push({tile:i,index:o}),i=l,o=0,r&&l.isComposite()&&r.enter(l))}else if(o==i.length)s=!!i.breakAfter,{tile:i,index:o}=a.pop(),o++;else if(t){let l=Math.min(t,i.length-o);r&&r.skip(i,o,o+l),t-=l,o+=l}else break;return this.tile=i,this.index=o,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class I2e{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class j2e{constructor(t,n,r){this.cache=t,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(t,n,r,i){var o;this.flushBuffer();let s=this.ensureMarks(n,r),a=s.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+t.length<512){this.cache.reused.set(a,2);let l=s.children[s.children.length-1]=new Sa(a.dom,a.text+t);l.parent=s}else s.append(i||Sa.of(t,(o=this.cache.find(Sa))===null||o===void 0?void 0:o.dom));this.pos+=t.length,this.afterWidget=null}addComposition(t,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Qx(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let a=n.marks.length-1;a>=0;a--){let l=n.marks[a],u=i.lastChild;if(u instanceof Wn&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(Qx(l.dom)),i=u;else{if(this.cache.reused.get(l)){let f=kt.get(l.dom);f&&f.setDOM(Qx(l.dom))}let c=Wn.of(l.mark,l.dom);i.append(c),i=c}this.cache.reused.set(l,2)}let o=kt.get(t.text);o&&this.cache.reused.set(o,2);let s=new Sa(t.text,t.text.nodeValue);s.flags|=8,i.append(s)}addInlineWidget(t,n,r){let i=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);i||this.flushBuffer();let o=this.ensureMarks(n,r);!i&&!(t.flags&16)&&o.append(this.getBuffer(1)),o.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var r;t||(t=y6);let i=cc.start(t,n||((r=this.cache.find(cc))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var r;let i=this.curLine;for(let o=t.length-1;o>=0;o--){let s=t[o],a;if(n>0&&(a=i.lastChild)&&a instanceof Wn&&a.mark.eq(s))i=a,n--;else{let l=Wn.of(s,(r=this.cache.find(Wn,u=>u.mark.eq(s)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!MR(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(oe.ios&&MR(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Xx,0,32)||new Za(Xx.toDOM(),0,Xx,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to<this.pos&&this.wrappers.splice(t,1);for(let t=this.blockWrappers;t.value&&t.from<=this.pos;t.next())if(t.to>=this.pos){let n=new I2e(t.from,t.to,t.value,t.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof wo&&i.wrapper.eq(r.wrapper))n=i;else{let o=wo.of(r.wrapper,(t=this.cache.find(wo,s=>s.wrapper.eq(r.wrapper)))===null||t===void 0?void 0:t.dom);n.append(o),n=o}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),r=this.cache.find(Xy,void 0,1);return r&&(r.flags=n),r||new Xy(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class R2e{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:i,lineBreak:o,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=i;let a=this.textOff=Math.min(t,i.length);return o?null:i.slice(0,a)}let n=Math.min(this.text.length,this.textOff+t),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const Yy=[Za,cc,Sa,Wn,Xy,wo,X0];for(let e=0;e<Yy.length;e++)Yy[e].bucket=e;class N2e{constructor(t){this.view=t,this.buckets=Yy.map(()=>[]),this.index=Yy.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,r=this.buckets[n];r.length<6?r.push(t):r[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,r=2){let i=t.bucket,o=this.buckets[i],s=this.index[i];for(let a=o.length-1;a>=0;a--){let l=(a+s)%o.length,u=o[l];if((!n||n(u))&&!this.reused.has(u))return o.splice(l,1),l<s&&this.index[i]--,this.reused.set(u,r),u}return null}findWidget(t,n,r){let i=this.buckets[0];if(i.length)for(let o=0,s=0;;o++){if(o==i.length){if(s)return null;s=1,o=0}let a=i[o];if(!this.reused.has(a)&&(s==0?a.widget.compare(t):a.widget.constructor==t.constructor&&t.updateDOM(a.dom,this.view,a.widget)))return i.splice(o,1),o<this.index[0]&&this.index[0]--,a.widget==t&&a.length==n&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new Za(a.dom,n,t,a.flags&-498|r))}}reuse(t){return this.reused.set(t,1),t}maybeReuse(t,n=2){if(!this.reused.has(t))return this.reused.set(t,n),t.dom}clear(){for(let t=0;t<this.buckets.length;t++)this.buckets[t].length=this.index[t]=0}}class D2e{constructor(t,n,r,i,o){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new N2e(t),this.text=new R2e(t.state.doc),this.builder=new j2e(this.cache,new X0(t,t.contentDOM),Pe.iter(r)),this.cache.reused.set(n,2),this.old=new M2e(n),this.reuseWalker={skip:(s,a,l)=>{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(t,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,o=0,s=0;;){let a=s<t.length?t[s++]:null,l=a?a.fromA:this.old.root.length;if(l>i){let u=l-i;this.preserve(u,!s,!a),i=l,o+=u}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(o,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(o,a.toB)),o=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(t,n,r){let i=B2e(this.old),o=this.openMarks;this.old.advance(t,r?1:-1,{skip:(s,a,l)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let u=l>0||a<s.length?Za.of(s.widget,this.view,l-a,s.flags&496,this.cache.maybeReuse(s)):this.cache.reuse(s);u.flags&256?(u.flags&=-2,this.builder.addBlockWidget(u)):(this.builder.ensureLine(null),this.builder.addInlineWidget(u,i,o),o=i.length)}else if(s.isText())this.builder.ensureLine(null),!a&&l==s.length&&!this.cache.reused.has(s)?this.builder.addText(s.text,i,o,this.cache.reuse(s)):(this.cache.add(s),this.builder.addText(s.text.slice(a,l),i,o)),o=i.length;else if(s.isLine())s.flags&=-2,this.cache.reused.set(s,1),this.builder.addLine(s);else if(s instanceof Xy)this.cache.add(s);else if(s instanceof Wn)this.builder.ensureLine(null),this.builder.addMark(s,i,o),this.cache.reused.set(s,1),o=i.length;else return!1;this.openWidget=!1},enter:s=>{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof Wn&&i.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?i.length&&(i.length=o=0):s instanceof Wn&&(i.shift(),o=Math.min(o,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let r=null,i=this.builder,o=0,s=Pe.spans(this.decorations,t,n,{point:(a,l,u,c,f,h)=>{if(u instanceof Xa){if(this.disallowBlockEffectsFor[h]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=c.length,f>c.length)i.continueWidget(l-a);else{let d=u.widget||(u.block?fc.block:fc.inline),p=L2e(u),m=this.cache.findWidget(d,l-a,p)||Za.of(d,this.view,l-a,p);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(m)):(i.ensureLine(r),i.addInlineWidget(m,c,f))}r=null}else r=$2e(r,u);l>a&&this.text.skip(l-a)},span:(a,l,u,c)=>{for(let f=a;f<l;){let h=this.text.next(Math.min(512,l-f));h==null?(i.addLineStartIfNotCovered(r),i.addBreak(),f++):(i.ensureLine(r),i.addText(h,u,f==a?c:u.length),f+=h.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=s>o,this.openMarks=s}forward(t,n,r=1){n-t<=10?this.old.advance(n-t,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(t){let n=[],r=null;for(let i=t.parentNode;;i=i.parentNode){let o=kt.get(i);if(i==this.view.contentDOM)break;o instanceof Wn?n.push(o):o?.isLine()?r=o:o instanceof wo||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new cc(i,y6):r||n.push(Wn.of(new ip({tagName:i.nodeName.toLowerCase(),attributes:f2e(i)}),i)))}return{line:r,marks:n}}}function MR(e,t){let n=r=>{for(let i of r.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}function L2e(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const y6={class:"cm-line"};function $2e(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&vP(n,e),r&&(e.class+=" "+r)),e}function B2e(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof Wn&&t.push(r.mark)}return t}function Qx(e){let t=kt.get(e);return t&&t.setDOM(e.cloneNode()),e}class fc extends Ji{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}fc.inline=new fc("span");fc.block=new fc("div");const Xx=new class extends Ji{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class IR{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=he.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new X0(t,t.contentDOM),this.updateInner([new Fr(0,0,0,t.state.doc.length)],null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:f})=>f<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!G2e(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let o=i>-1?z2e(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;r=new Fr(c,f,t.changes.mapPos(c,-1),t.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(oe.ie||oe.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let l=H2e(s,this.decorations,t.changes);l.length&&(r=Fr.extendWithRanges(r,l));let u=q2e(a,this.blockWrappers,t.changes);return u.length&&(r=Fr.extendWithRanges(r,u)),o&&!r.some(c=>c.fromA<=o.range.fromA&&c.toA>=o.range.toA)&&(r=o.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,o),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||t.length){let s=this.tile,a=new D2e(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&kt.get(n.text)&&a.cache.reused.set(kt.get(n.text),2),this.tile=a.run(t,n),Yk(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=oe.chrome||oe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||r.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof Yx&&i.push(o.dom);r.updateGaps(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let n of t.transactions)for(let r of n.effects)r.is(h6)&&(this.editContextFormatting=r.value)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,s=!o&&!(this.view.state.facet(lo)||r.tabIndex>-1)&&rh(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),oe.gecko&&l.empty&&!this.hasComposition&&F2e(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=c=new ui(h,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!oh(u.node,u.offset,f.anchorNode,f.anchorOffset)||!oh(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,l))&&(this.view.observer.ignore(()=>{oe.android&&oe.chrome&&r.contains(f.focusNode)&&K2e(f.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let h=Ad(this.view.root);if(h)if(l.empty){if(oe.gecko){let d=W2e(u.node,u.offset);if(d&&d!=3){let p=(d==1?X8:Y8)(u.node,u.offset);p&&(u=new ui(p.node,p.offset))}}h.collapse(u.node,u.offset),l.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=l.bidiLevel)}else if(h.extend){h.collapse(u.node,u.offset);try{h.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),d.setEnd(c.node,c.offset),d.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(d)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new ui(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new ui(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&oh(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=Ad(t.root),{anchorNode:i,anchorOffset:o}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!l||!u||l.bottom>u.top)return;let c=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(c.node,c.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}posFromDOM(t,n){let r=this.tile.nearest(t);if(!r)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let o;if(t==r.dom)o=r.dom.childNodes[n];else{let s=Mo(t)==0?0:n==0?-1:1;for(;;){let a=t.parentNode;if(a==r.dom)break;s==0&&a.firstChild!=a.lastChild&&(t==a.firstChild?s=-1:s=1),t=a}s<0?o=t:o=t.nextSibling}if(o==r.dom.firstChild)return i;for(;o&&!kt.get(o);)o=o.nextSibling;if(!o)return i+r.length;for(let s=0,a=i;;s++){let l=r.children[s];if(l.dom==o)return a;a+=l.length+l.breakAfter}}else return r.isText()?t==r.dom?i+n:i+(n?r.length:0):i}domAtPos(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.domPosFor(t,n):r.domIn(i,n)}inlineDOMNearPos(t,n){let r,i=-1,o=!1,s,a=-1,l=!1;return this.tile.blockTiles((u,c)=>{if(u.isWidget()){if(u.flags&32&&c>=t)return!0;u.flags&16&&(o=!0)}else{let f=c+u.length;if(c<=t&&(r=u,i=t-c,o=f<t),f>=t&&!s&&(s=u,a=t-c,l=c>t),c>t&&s)return!0}}),!r&&!s?this.domAtPos(t,n):(o&&s?r=null:l&&r&&(s=null),r&&n<0||!s?r.domIn(i,n):s.domIn(a,n))}coordsAt(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.widget instanceof Yx?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(t,n){let{tile:r}=this.tile.resolveBlock(t,n);return r.isLine()?r:null}coordsForChar(t){let{tile:n,offset:r}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function i(o,s){if(o.isComposite())for(let a of o.children){if(a.length>=s){let l=i(a,s);if(l)return l}if(s-=a.length,s<0)break}else if(o.isText()&&s<o.length){let a=Yt(o.text,s);if(a==s)return null;let l=Ed(o.dom,s,a).getClientRects();for(let u=0;u<l.length;u++){let c=l[u];if(u==l.length-1||c.top<c.bottom&&c.left<c.right)return c}}return null}return i(n,r)}measureVisibleLineHeights(t){let n=[],{from:r,to:i}=t,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Ye.LTR,u=0,c=(f,h,d)=>{for(let p=0;p<f.children.length&&!(h>i);p++){let m=f.children[p],y=h+m.length,g=m.dom.getBoundingClientRect(),{height:v}=g;if(d&&!p&&(u+=g.top-d.top),m instanceof wo)y>r&&c(m,h,g);else if(h>=r&&(u>0&&n.push(-u),n.push(v+u),u=0,s)){let x=m.dom.lastChild,k=x?ih(x):[];if(k.length){let w=k[k.length-1],S=l?w.right-g.left:g.right-w.left;S>a&&(a=S,this.minWidth=o,this.minWidthFrom=h,this.minWidthTo=y)}}d&&p==f.children.length-1&&(u+=d.bottom-g.bottom),h=y+m.breakAfter}};return c(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?Ye.RTL:Ye.LTR}measureTextSize(){let t=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,l;for(let u of s.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let c=ih(u.dom);if(c.length!=1)return;a+=c[0].width,l=c[0].height}if(a)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:a/s.length,textHeight:l}}});if(t)return t;let n=document.createElement("div"),r,i,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=ih(n.firstChild)[0];r=n.getBoundingClientRect().height,i=s&&s.width?s.width/27:7,o=s&&s.height?s.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:o}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.view.state.doc.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(he.replace({widget:new Yx(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return he.set(t)}updateDeco(){let t=1,n=this.view.state.facet(G0).map(o=>(this.dynamicDecorationMap[t++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(OP).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(Pe.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;this.blockWrappers=this.view.state.facet(p6).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(t){var n;if(t.isSnapshot){let c=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=c.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let c of this.view.state.facet(f6))try{if(c(this.view,t.range,t))return!0}catch(f){Kn(this.view.state,f,"scroll handler")}let{range:r}=t,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),o;if(!i)return;!r.empty&&(o=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,o.left),top:Math.min(i.top,o.top),right:Math.max(i.right,o.right),bottom:Math.max(i.bottom,o.bottom)});let s=CP(this.view),a={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:u}=this.view.scrollDOM;if(p2e(this.view.scrollDOM,a,r.head<r.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,u),-u),this.view.textDirection==Ye.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(r.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(t){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){Yk(this.tile)}}function Yk(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)Yk(r,t)}}function F2e(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function v6(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=X8(n.focusNode,n.focusOffset),i=Y8(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let a=kt.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let l=kt.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function z2e(e,t,n){let r=v6(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc;return{range:new Fr(l.mapPos(o),l.mapPos(s),o,s),text:i}}function W2e(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable=="false"?2:0)}let U2e=class{constructor(){this.changes=[]}compareRange(t,n){bu(t,n,this.changes)}comparePoint(t,n){bu(t,n,this.changes)}boundChange(t){bu(t,t,this.changes)}};function H2e(e,t,n){let r=new U2e;return Pe.compare(e,t,n,r),r.changes}class V2e{constructor(){this.changes=[]}compareRange(t,n){bu(t,n,this.changes)}comparePoint(){}boundChange(t){bu(t,t,this.changes)}}function q2e(e,t,n){let r=new V2e;return Pe.compare(e,t,n,r),r.changes}function K2e(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function G2e(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class Yx extends Ji{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Q2e(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(i.length==0)return V.cursor(t);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=Yt(i.text,o,!1):a=Yt(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let u=Yt(i.text,s,!1);if(r(i.text.slice(u,s))!=l)break;s=u}for(;a<i.length;){let u=Yt(i.text,a);if(r(i.text.slice(a,u))!=l)break;a=u}return V.range(s+i.from,a+i.from)}function X2e(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let a=e.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(e.defaultLineHeight-a)*.5)/a);o+=l*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+Bk(s,o,e.state.tabSize)}function Zk(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let o of r.type){if(o.from>t)break;if(!(o.to<t)){if(o.from<t&&o.to>t)return o;(!i||o.type==fn.Text&&(i.type!=o.type||(n<0?o.from<t:o.to>t)))&&(i=o)}}return i||r}return r}function Y2e(e,t,n,r){let i=Zk(e,t.head,t.assoc||-1),o=!r||i.type!=fn.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(o){let s=e.dom.getBoundingClientRect(),a=e.textDirectionAt(i.from),l=e.posAtCoords({x:n==(a==Ye.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return V.cursor(l,n?-1:1)}return V.cursor(n?i.to:i.from,n?-1:1)}function jR(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let u=C2e(i,o,s,a,n),c=n6;if(!u){if(i.number==(n?e.state.doc.lines:1))return a;c=`
410
+ `,i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),u=e.visualLineSide(i,!n)}if(l){if(!l(c))return a}else{if(!r)return u;l=r(c)}a=u}}function Z2e(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return o=>{let s=r(o);return i==gt.Space&&(i=s),i==s}}function J2e(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return V.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),c=e.documentTop;if(u)s==null&&(s=u.left-l.left),a=o<0?u.top:u.bottom;else{let p=e.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-p.from))),a=(o<0?p.top:p.bottom)+c}let f=l.left+s,h=e.viewState.heightOracle.textHeight>>1,d=r??h;for(let p=0;;p+=h){let m=a+(d+p)*o,y=Jk(e,{x:f,y:m},!1,o);if(n?m>l.bottom:m<l.top)return V.cursor(y.pos,y.assoc);let g=e.coordsAtPos(y.pos,y.assoc),v=g?(g.top+g.bottom)/2:0;if(!g||(n?v>a:v<a))return V.cursor(y.pos,y.assoc,void 0,s)}}function sh(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(o,s,a)=>{if(t>o&&t<s){let l=r||n||(t-o<s-t?-1:1);t=l<0?o:s,r=l}});if(!r)return t}}function b6(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let s=sh(e,i.from,0);s!=i.from&&(o=V.cursor(s,-1))}else{let s=sh(e,i.from,-1),a=sh(e,i.to,1);(s!=i.from||a!=i.to)&&(o=V.range(i.from==i.anchor?s:a,i.from==i.head?s:a))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?V.create(n,t.mainIndex):t}function Zx(e,t,n){let r=sh(e.state.facet(sp).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:V.cursor(r,r<n.from?1:-1)}class ji{constructor(t,n){this.pos=t,this.assoc=n}}function Jk(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),o=i.top+e.viewState.paddingTop,{x:s,y:a}=t,l=a-o,u;for(;;){if(l<0)return new ji(0,1);if(l>e.viewState.docHeight)return new ji(e.state.doc.length,-1);if(u=e.elementAtHeight(l),r==null)break;if(u.type==fn.Text){if(r<0?u.to<e.viewport.from:u.from>e.viewport.to)break;let h=e.docView.coordsAt(r<0?u.from:u.to,r>0?-1:1);if(h&&(r<0?h.top<=l+o:h.bottom>=l+o))break}let f=e.viewState.heightOracle.textHeight/2;l=r>0?u.bottom+f:u.top-f}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==fn.Text){let f=X2e(e,i,u,s,a);return new ji(f,f==u.from?1:-1)}}if(u.type!=fn.Text)return l<(u.top+u.bottom)/2?new ji(u.from,1):new ji(u.to,-1);let c=e.docView.lineAt(u.from,2);return(!c||c.length!=u.length)&&(c=e.docView.lineAt(u.from,-2)),new eMe(e,s,a,e.textDirectionAt(u.from)).scanTile(c,u.from)}class eMe{constructor(t,n,r,i){this.view=t,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to<t)&&(this.line=this.view.state.doc.lineAt(t),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Ni.find(i,t-r.from,-1,n)].level==this.baseDir}dirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Ni.find(i,t-r.from,-1,n)].dir}bidiIn(t,n){let{spans:r,line:i}=this.bidiSpansAt(t);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(t,n){let r=0,i=t.length-1,o=new Set,s=this.bidiIn(t[0],t[i]),a,l,u=-1,c=1e9,f;e:for(;r<i;){let d=i-r,p=r+i>>1;t:if(o.has(p)){let y=r+Math.floor(Math.random()*d);for(let g=0;g<d;g++){if(!o.has(y)){p=y;break t}y++,y==i&&(y=r)}break e}o.add(p);let m=n(p);if(m)for(let y=0;y<m.length;y++){let g=m[y],v=0;if(!(g.width==0&&m.length>1)){if(g.bottom<this.y)(!a||a.bottom<g.bottom)&&(a=g),v=1;else if(g.top>this.y)(!l||l.top>g.top)&&(l=g),v=-1;else{let x=g.left>this.x?this.x-g.left:g.right<this.x?this.x-g.right:0,k=Math.abs(x);k<c&&(u=p,c=k,f=g),x&&(v=x<0==(this.baseDir==Ye.LTR)?-1:1)}v==-1&&(!s||this.baseDirAt(t[p],1))?i=p:v==1&&(!s||this.baseDirAt(t[p+1],-1))&&(r=p+1)}}}if(!f){let d=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(d.top+d.bottom)/2,this.scan(t,n)}if(c){let{top:d,bottom:p}=f;if(a&&a.bottom>(d+d+p)/3)return this.y=a.bottom-1,this.scan(t,n);if(l&&l.top<(d+p+p)/3)return this.y=l.top+1,this.scan(t,n)}let h=(s?this.dirAt(t[u],1):this.baseDir)==Ye.LTR;return{i:u,after:this.x>(f.left+f.right)/2==h}}scanText(t,n){let r=[];for(let o=0;o<t.length;o=Yt(t.text,o))r.push(n+o);r.push(n+t.length);let i=this.scan(r,o=>{let s=r[o]-n,a=r[o+1]-n;return Ed(t.dom,s,a).getClientRects()});return i.after?new ji(r[i.i+1],-1):new ji(r[i.i],1)}scanTile(t,n){if(!t.length)return new ji(n,1);if(t.children.length==1){let a=t.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let r=[n];for(let a=0,l=n;a<t.children.length;a++)r.push(l+=t.children[a].length);let i=this.scan(r,a=>{let l=t.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Ed(l.dom,0,l.length)).getClientRects()}),o=t.children[i.i],s=r[i.i];return o.isText()?this.scanText(o,s):o.isComposite()?this.scanTile(o,s):i.after?new ji(r[i.i+1],-1):new ji(s,1)}}const Ml="￿";class tMe{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(_e.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=Ml}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=kt.get(i),a=i.nextSibling;if(a==n){s?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=kt.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:Gy(i))||Gy(a)&&(i.nodeName!="BR"||s?.isWidget())&&this.text.length>o)&&!rMe(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==t&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(t){let n=kt.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(nMe(t,r.node,r.offset)?n:0))}}function nMe(e,t,n){for(;;){if(!t||n<Mo(t))return!1;if(t==e)return!0;n=Ms(t)+1,t=t.parentNode}}function rMe(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=kt.get(e);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class RR{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class iMe{constructor(t,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:s}=t.docView,a=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=x6(t.docView.tile,n,r,0))){let l=o||s?[]:sMe(t),u=new tMe(l,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=aMe(l,this.bounds.from)}else{let l=t.observer.selectionRange,u=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!qk(t.contentDOM,l.focusNode)?a.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!qk(t.contentDOM,l.anchorNode)?a.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),f=t.viewport;if((oe.ios||oe.chrome)&&a.main.empty&&u!=c&&(f.from>0||f.to<t.state.doc.length)){let h=Math.min(u,c),d=Math.max(u,c),p=f.from-h,m=f.to-d;(p==0||p==1||h==0)&&(m==0||m==-1||d==t.state.doc.length)&&(u=0,c=t.state.doc.length)}if(t.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(V.range(c,u));else if(t.lineWrapping&&c==u&&!(a.main.empty&&a.main.head==u)&&t.inputState.lastTouchTime>Date.now()-100){let h=t.coordsAtPos(u,-1),d=0;h&&(d=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=V.create([V.cursor(u,d)])}else this.newSel=V.single(c,u)}}}function x6(e,t,n,r){if(e.isComposite()){let i=-1,o=-1,s=-1,a=-1;for(let l=0,u=r,c=r;l<e.children.length;l++){let f=e.children[l],h=u+f.length;if(u<t&&h>n)return x6(f,t,n,u);if(h>=t&&i==-1&&(i=l,o=u),u>n&&f.dom.parentNode==e.dom){s=l,a=c;break}c=h,u=h+f.breakAfter}return{from:o,to:a<0?r+e.length:a,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s<e.children.length&&s>=0?e.children[s].dom:null}}else return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function w6(e,t){let n,{newSel:r}=t,{state:i}=e,o=i.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:a,to:l}=t.bounds,u=o.from,c=null;(s===8||oe.android&&t.text.length<l-a)&&(u=o.to,c="end");let f=i.doc.sliceString(a,l,Ml),h,d;!o.empty&&o.from>=a&&o.to<=l&&(t.typeOver||f!=t.text)&&f.slice(0,o.from-a)==t.text.slice(0,o.from-a)&&f.slice(o.to-a)==t.text.slice(h=t.text.length-(f.length-(o.to-a)))?n={from:o.from,to:o.to,insert:Me.of(t.text.slice(o.from-a,h).split(Ml))}:(d=S6(f,t.text,u-a,c))&&(oe.chrome&&s==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==Ml+Ml&&d.toB--,n={from:a+d.from,to:a+d.toA,insert:Me.of(t.text.slice(d.from,d.toB).split(Ml))})}else r&&(!e.hasFocus&&i.facet(lo)||Zy(r,o))&&(r=null);if(!n&&!r)return!1;if((oe.mac||oe.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=V.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Me.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:i.toText(e.inputState.insertingText)}:oe.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==`
411
+ `&&e.lineWrapping&&(r&&(r=V.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:Me.of([" "])}),n)return AP(e,n,r,s);if(r&&!Zy(r,o)){let a=!1,l="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(a=!0),l=e.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=b6(i.facet(sp).map(u=>u(e)),r))),e.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function AP(e,t,n,r=-1){if(oe.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(oe.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&xu(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&xu(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&xu(e.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let s,a=()=>s||(s=oMe(e,t,n));return e.state.facet(a6).some(l=>l(e,t.from,t.to,o,a))||e.dispatch(a()),!0}function oMe(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let l=t.from<o.from?-1:1,u=l<0?o.from:o.to,c=sh(i.facet(sp).map(f=>f(e)),u,l);t.from==c&&(s=c)}if(s>-1)r={changes:t,selection:V.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let l=o.from<t.from?i.sliceDoc(o.from,t.from):"",u=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(l+t.insert.sliceString(0,void 0,e.state.lineBreak)+u))}else{let l=i.changes(t),u=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let c=e.state.sliceDoc(t.from,t.to),f,h=n&&v6(e,n.main.head);if(h){let p=t.insert.length-(t.to-t.from);f={from:h.from,to:h.to-p}}else f=e.state.doc.lineAt(o.head);let d=o.to-t.to;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:u||p.map(l)};let m=p.to-d,y=m-c.length;if(e.state.sliceDoc(y,m)!=c||m>=f.from&&y<=f.to)return{range:p};let g=i.changes({from:y,to:m,insert:t.insert}),v=p.to-o.to;return{changes:g,range:u?V.range(Math.max(0,u.anchor+v),Math.max(0,u.head+v)):p.map(g)}})}else r={changes:l,selection:u&&i.selection.replaceRange(u)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function S6(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&e.length<t.length){let l=n<=o&&n>=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function sMe(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new RR(n,r)),(i!=n||o!=r)&&t.push(new RR(i,o))),t}function aMe(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?V.single(n+t,r+t):null}function Zy(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class lMe{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,oe.safari&&t.contentDOM.addEventListener("input",()=>null),oe.gecko&&kMe(t.contentDOM.ownerDocument)}handleEvent(t){!gMe(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=uMe(t),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&O6.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),oe.android&&oe.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return oe.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&!t.shiftKey&&((n=k6.find(r=>r.keyCode==t.keyCode))&&!t.ctrlKey||cMe.indexOf(t.key)>-1&&t.ctrlKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,xu(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(t){return!/^key/.test(t.type)||t.synthetic?!1:this.composing>0?!0:oe.safari&&!oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function NR(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){Kn(n.state,i)}}}function uMe(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,o=i&&i.plugin.domEventHandlers,s=i&&i.plugin.domEventObservers;if(o)for(let a in o){let l=o[a];l&&n(a).handlers.push(NR(r.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(NR(r.value,l))}}for(let r in pi)n(r).handlers.push(pi[r]);for(let r in er)n(r).observers.push(er[r]);return t}const k6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],cMe="dthko",O6=[16,17,18,20,91,92,224,225],im=6;function om(e){return Math.max(0,e)*.7+8}function fMe(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class hMe{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=K8(t.contentDOM),this.atoms=t.state.facet(sp).map(s=>s(t));let o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(_e.allowMultipleSelections)&&dMe(t,n),this.dragging=mMe(t,n)&&P6(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&fMe(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=CP(this.view);t.clientX-l.left<=i+im?n=-om(i-t.clientX):t.clientX+l.right>=s-im&&(n=om(t.clientX-s)),t.clientY-l.top<=o+im?r=-om(o-t.clientY):t.clientY+l.bottom>=a-im&&(r=om(t.clientY-a)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=b6(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function dMe(e,t){let n=e.state.facet(r6);return n.length?n[0](t):oe.mac?t.metaKey:t.ctrlKey}function pMe(e,t){let n=e.state.facet(i6);return n.length?n[0](t):oe.mac?!t.altKey:!t.ctrlKey}function mMe(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Ad(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=t.clientX&&s.right>=t.clientX&&s.top<=t.clientY&&s.bottom>=t.clientY)return!0}return!1}function gMe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=kt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const pi=Object.create(null),er=Object.create(null),C6=oe.ie&&oe.ie_version<15||oe.ios&&oe.webkit_version<604;function yMe(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),A6(e,n.value)},50)}function Y0(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function A6(e,t){t=Y0(e.state,wP,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(eO!=null&&n.selection.ranges.every(l=>l.empty)&&eO==o.toString()){let l=-1;r=n.changeByRange(u=>{let c=n.doc.lineAt(u.from);if(c.from==l)return{range:u};l=c.from;let f=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:c.from,insert:f},range:V.cursor(u.from+f.length)}})}else s?r=n.changeByRange(l=>{let u=o.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:V.cursor(l.from+u.length)}}):r=n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}er.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};er.wheel=er.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};pi.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);er.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};er.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};pi.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(o6))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=bMe(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new hMe(e,t,n,r)),r&&e.observer.ignore(()=>{G8(e.contentDOM);let o=e.root.activeElement;o&&!o.contains(e.contentDOM)&&o.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function DR(e,t,n,r){if(r==1)return V.cursor(t,n);if(r==2)return Q2e(e.state,t,n);{let i=e.docView.lineAt(t,n),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,V.range(s,a)}}const vMe=oe.ie&&oe.ie_version<=11;let LR=null,$R=0,BR=0;function P6(e){if(!vMe)return e.detail;let t=LR,n=BR;return LR=e,BR=Date.now(),$R=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?($R+1)%3:1}function bMe(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=P6(t),i=e.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=e.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),u,c=DR(e,l.pos,l.assoc,r);if(n.pos!=l.pos&&!s){let f=DR(e,n.pos,n.assoc,r),h=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=h<c.from?V.range(h,d,c.assoc):V.range(d,h,c.assoc)}return s?i.replaceRange(i.main.extend(c.from,c.to,c.assoc)):a&&r==1&&i.ranges.length>1&&(u=xMe(i,l.pos))?u:a?i.addRange(c):V.create([c])}}}function xMe(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return V.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}pi.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=V.range(o,s))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",Y0(e.state,SP,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};pi.dragend=e=>(e.inputState.draggedContent=null,!1);function FR(e,t,n,r){if(n=Y0(e.state,wP,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=r&&o&&pMe(e,t)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}pi.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&FR(e,t,r.filter(s=>s!=null).join(e.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=o,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return FR(e,t,r,!0),!0}return!1};pi.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=C6?null:t.clipboardData;return n?(A6(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(yMe(e),!1)};function wMe(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function SMe(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:o}of e.selection.ranges){let s=e.doc.lineAt(o);s.number>i&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),i=s.number}r=!0}return{text:Y0(e,SP,t.join(e.lineBreak)),ranges:n,linewise:r}}let eO=null;pi.copy=pi.cut=(e,t)=>{if(!rh(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=SMe(e.state);if(!n&&!i)return!1;eO=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=C6?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(wMe(e,n),!1)};const E6=Yi.define();function T6(e,t){let n=[];for(let r of e.facet(l6)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:E6.of(!0)}):null}function _6(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=T6(e.state,t);n?e.dispatch(n):e.update([])}},10)}er.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),_6(e)};er.blur=e=>{e.observer.clearSelectionRange(),_6(e)};er.compositionstart=er.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};er.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,oe.chrome&&oe.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};er.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};pi.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let o=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=t.getTargetRanges();if(o&&s.length){let a=s[0],l=e.posAtDOM(a.startContainer,a.startOffset),u=e.posAtDOM(a.endContainer,a.endOffset);return AP(e,{from:l,to:u,insert:e.state.toText(o)},null),!0}}let i;if(oe.chrome&&oe.android&&(i=k6.find(o=>o.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return oe.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),oe.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>er.compositionend(e,t),20),!1};const zR=new Set;function kMe(e){zR.has(e)||(zR.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const WR=["pre-wrap","normal","pre-line","break-spaces"];let hc=!1;function UR(){hc=!1}class OMe{constructor(t){this.lineWrapping=t,this.doc=Me.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return WR.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(t,n,r,i,o,s){let a=WR.indexOf(t)>-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let u=0;u<s.length;u++){let c=s[u];c<0?u++:this.heightSamples[Math.floor(c*10)]=!0}}return l}}class CMe{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class li{constructor(t,n,r,i,o){this.from=t,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?fn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Xa?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new li(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var tt=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(tt||(tt={}));const Km=.001;class Nn{constructor(t,n,r=2){this.length=t,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>Km&&(hc=!0),this.height=t)}replace(t,n,r){return Nn.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:u,fromB:c,toB:f}=i[a],h=o.lineAt(l,tt.ByPosNoHeight,r.setDoc(n),0,0),d=h.to>=u?h:o.lineAt(u,tt.ByPosNoHeight,r,0,0);for(f+=d.to-u,u=d.to;a>0&&h.from<=i[a-1].toA;)l=i[a-1].fromA,c=i[a-1].fromB,a--,l<h.from&&(h=o.lineAt(l,tt.ByPosNoHeight,r,0,0));c+=h.from-l,l=h.from;let p=PP.build(r.setDoc(s),t,c,f);o=Jy(o,o.replace(l,u,p))}return o.updateHeight(r,0)}static empty(){return new pr(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=t[r];a.break?t.splice(r,1,a.left,null,a.right):t.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i<o){let a=t[n++];a&&(i+=a.size)}else{let a=t[--r];a&&(o+=a.size)}let s=0;return t[n-1]==null?(s=1,n--):t[n]==null&&(s=1,r++),new PMe(Nn.of(t.slice(0,n)),s,Nn.of(t.slice(r)))}}function Jy(e,t){return e==t?e:(e.constructor!=t.constructor&&(hc=!0),t)}Nn.prototype.size=1;const AMe=he.replace({});class M6 extends Nn{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new li(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(t,n,r,i){return this.spaceAbove&&t<r+this.spaceAbove?new li(i,0,r,this.spaceAbove,AMe):this.mainBlock(r,i)}lineAt(t,n,r,i,o){let s=this.mainBlock(i,o);return this.spaceAbove?this.blockAt(0,r,i,o).join(s):s}forEachLine(t,n,r,i,o,s){t<=o+this.length&&n>=o&&s(this.lineAt(0,tt.ByPos,r,i,o))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class pr extends M6{constructor(t,n,r){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(t,n){return new li(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof pr||i instanceof sn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof sn?i=new pr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Nn.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class sn extends Nn{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(t.lineWrapping){let l=Math.min(this.height,t.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(t,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let u=i+(t<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-r)/this.height))*this.length)),c=n.doc.lineAt(u),f=a+c.length*l,h=Math.max(r,t-f/2);return new li(c.from,c.length,h,f,0)}else{let u=Math.max(0,Math.min(s-o,Math.floor((t-r)/a))),{from:c,length:f}=n.doc.line(o+u);return new li(c,f,r+a*u,a,0)}}lineAt(t,n,r,i,o){if(n==tt.ByHeight)return this.blockAt(t,r,i,o);if(n==tt.ByPosNoHeight){let{from:d,to:p}=r.doc.lineAt(t);return new li(d,p-d,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,o),u=r.doc.lineAt(t),c=a+u.length*l,f=u.number-s,h=i+a*f+l*(u.from-o-f);return new li(u.from,u.length,Math.max(i,Math.min(h,i+this.height-c)),c,0)}forEachLine(t,n,r,i,o,s){t=Math.max(t,o),n=Math.min(n,o+this.length);let{firstLine:a,perLine:l,perChar:u}=this.heightMetrics(r,o);for(let c=t,f=i;c<=n;){let h=r.doc.lineAt(c);if(c==t){let p=h.number-a;f+=l*p+u*(t-o-p)}let d=l+u*h.length;s(new li(h.from,h.length,f,d,0)),f+=d,c=h.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof sn?r[r.length-1]=new sn(o.length+i):r.push(null,new sn(i-1))}if(t>0){let o=r[0];o instanceof sn?r[0]=new sn(t+o.length):r.unshift(new sn(t-1),null)}return Nn.of(r)}decomposeLeft(t,n){n.push(new sn(t-1),null)}decomposeRight(t,n){n.push(null,new sn(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new sn(i.from-n-1).updateHeight(t,n));a<=o&&i.more;){let c=t.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++],h=0;f<0&&(h=-f,f=i.heights[i.index++]),l==-1?l=f:Math.abs(f-l)>=Km&&(l=-2);let d=new pr(c,f,h);d.outdated=!1,s.push(d),a+=c+1}a<=o&&s.push(null,new sn(o-a).updateHeight(t,a));let u=Nn.of(s);return(l<0||Math.abs(u.height-this.height)>=Km||Math.abs(l-this.heightMetrics(t,n).perLine)>=Km)&&(hc=!0),Jy(this,u)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class PMe extends Nn{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let o=r+this.left.height;return t<o?this.left.blockAt(t,n,r,i):this.right.blockAt(t,n,o,i+this.left.length+this.break)}lineAt(t,n,r,i,o){let s=i+this.left.height,a=o+this.left.length+this.break,l=n==tt.ByHeight?t<s:t<a,u=l?this.left.lineAt(t,n,r,i,o):this.right.lineAt(t,n,r,s,a);if(this.break||(l?u.to<a:u.from>a))return u;let c=n==tt.ByPosNoHeight?tt.ByPosNoHeight:tt.ByPos;return l?u.join(this.right.lineAt(a,c,r,s,a)):this.left.lineAt(a,c,r,i,o).join(u)}forEachLine(t,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)t<l&&this.left.forEachLine(t,n,r,i,o,s),n>=l&&this.right.forEachLine(t,n,r,a,l,s);else{let u=this.lineAt(l,tt.ByPos,r,i,o);t<u.from&&this.left.forEachLine(t,u.from-1,r,i,o,s),u.to>=t&&u.from<=n&&s(u),n>u.to&&this.right.forEachLine(u.to+1,n,r,a,l,s)}}replace(t,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(t,n,r),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let o=[];t>0&&this.decomposeLeft(t,o);let s=o.length;for(let a of r)o.push(a);if(t>0&&HR(o,s-1),n<this.length){let a=o.length;this.decomposeRight(n,o),HR(o,a)}return Nn.of(o)}decomposeLeft(t,n){let r=this.left.length;if(t<=r)return this.left.decomposeLeft(t,n);n.push(this.left),this.break&&(r++,t>=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t<r&&this.left.decomposeRight(t,n),this.break&&t<i&&n.push(null),n.push(this.right)}balanced(t,n){return t.size>2*n.size||n.size>2*t.size?Nn.of(this.break?[t,null,n]:[t,n]):(this.left=Jy(this.left,t),this.right=Jy(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(t,n,r,i):o.updateHeight(t,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(t,a,r,i):s.updateHeight(t,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function HR(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof sn&&(r=e[t+1])instanceof sn&&e.splice(t-1,3,new sn(n.length+1+r.length))}const EMe=5;class PP{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof pr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new pr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-t;r.block?this.addBlock(new M6(s,i,r)):(s||o||i>=EMe)&&this.addLineDeco(i,o,s)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new pr(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new sn(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof pr)return t;let n=new pr(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof pr)&&!this.isCovered?this.nodes.push(new pr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=t;for(let i of this.nodes)i instanceof pr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let o=new PP(r,t);return Pe.spans(n,r,i,o,0),o.finish(r)}}function TMe(e,t,n){let r=new _Me;return Pe.compare(e,t,n,r,0),r.changes}class _Me{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&bu(t,n,this.changes,5)}}function MMe(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let u=e.parentNode;u&&u!=r.body;)if(u.nodeType==1){let c=u,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let h=c.getBoundingClientRect();o=Math.max(o,h.left),s=Math.min(s,h.right),a=Math.max(a,h.top),l=Math.min(u==e.parentNode?i.innerHeight:l,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function IMe(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function jMe(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class Jx{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(t,n){return he.replace({widget:new RMe(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class RMe extends Ji{constructor(t,n){super(),this.size=t,this.vertical=n}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class VR{constructor(t,n){this.view=t,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=qR,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Ye.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(kP).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new OMe(r),this.stateDeco=KR(n),this.heightMap=Nn.empty().applyChanges(this.stateDeco,Me.empty,this.heightOracle.setDoc(n.doc),[new Fr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=he.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);t.push(new sm(o,s))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?qR:new EP(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(jf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=KR(this.state);let i=t.changedRanges,o=Fr.extendWithRanges(i,TMe(r,this.stateDeco,t?t.changes:Bt.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);UR(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||hc)&&(t.flags|=2),a?(this.scrollAnchorPos=t.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let u=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(u||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(c6)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Ye.RTL:Ye.LTR;let s=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let u=0,c=0;if(a.width&&a.height){let{scaleX:w,scaleY:S}=q8(n,a);(w>.005&&Math.abs(this.scaleX-w)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=w,this.scaleY=S,u|=16,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,u|=16);let d=K8(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Q8(this.scrollParent||t.win);let m=(this.printing?jMe:MMe)(n,this.paddingTop),y=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget&&!IMe(t.dom))return 0;let x=a.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),l){let w=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(w)&&(s=!0),s||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:O,textHeight:A}=t.docView.measureTextSize();s=S>0&&i.refresh(o,S,O,A,Math.max(5,x/O),w),s&&(t.docView.minWidth=0,u|=16)}y>0&&g>0?c=Math.max(y,g):y<0&&g<0&&(c=Math.min(y,g)),UR();for(let S of this.viewports){let O=S.from==this.viewport.from?w:t.docView.measureVisibleLineHeights(S);this.heightMap=(s?Nn.empty().applyChanges(this.stateDeco,Me.empty,this.heightOracle,[new Fr(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new CMe(S.from,O))}hc&&(u|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new sm(i.lineAt(s-r*1e3,tt.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,tt.ByHeight,o,0,0).to);if(n){let{head:u}=n.range;if(u<l.from||u>l.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(u,tt.ByPos,o,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-c/2:n.y=="start"||n.y=="nearest"&&u<l.from?h=f.top:h=f.bottom-c,l=new sm(i.lineAt(h-1e3/2,tt.ByHeight,o,0,0).from,i.lineAt(h+c+1e3/2,tt.ByHeight,o,0,0).to)}}return l}mapViewport(t,n){let r=n.mapPos(t.from,-1),i=n.mapPos(t.to,1);return new sm(this.heightMap.lineAt(r,tt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,tt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,tt.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,tt.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(t==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<a+2*1e3}mapLineGaps(t,n){if(!t.length||n.empty)return t;let r=[];for(let i of t)n.touchesRange(i.from,i.to)||r.push(new Jx(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(t,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=Ye.LTR&&!r)return[];let a=[],l=(c,f,h,d)=>{if(f-c<o)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let g of m)if(g>c&&g<f){l(c,g-10,h,d),l(g+10,f,h,d);return}let y=DMe(t,g=>g.from>=h.from&&g.to<=h.to&&Math.abs(g.from-c)<o&&Math.abs(g.to-f)<o&&!m.some(v=>g.from<v&&g.to>v));if(!y){if(f<h.to&&n&&r&&n.visibleRanges.some(x=>x.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(V.cursor(f),!1,!0).head;x>c&&(f=x)}let g=this.gapSize(h,c,f,d),v=r||g<2e6?g:2e6;y=new Jx(c,f,g,v)}a.push(y)},u=c=>{if(c.length<s||c.type!=fn.Text)return;let f=NMe(c.from,c.to,this.stateDeco);if(f.total<s)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(r){let m=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,y,g;if(h!=null){let v=lm(f,h),x=((this.visibleBottom-this.visibleTop)/2+m)/c.height;y=v-x,g=v+x}else y=(this.visibleTop-c.top-m)/c.height,g=(this.visibleBottom-c.top+m)/c.height;d=am(f,y),p=am(f,g)}else{let m=f.total*this.heightOracle.charWidth,y=i*this.heightOracle.charWidth,g=0;if(m>2e6)for(let S of t)S.from>=c.from&&S.from<c.to&&S.size!=S.displaySize&&S.from*this.heightOracle.charWidth+g<this.pixelViewport.left&&(g=S.size-S.displaySize);let v=this.pixelViewport.left+g,x=this.pixelViewport.right+g,k,w;if(h!=null){let S=lm(f,h),O=((x-v)/2+y)/m;k=S-O,w=S+O}else k=(v-y)/m,w=(x+y)/m;d=am(f,k),p=am(f,w)}d>c.from&&l(c.from,d,c,f),p<c.to&&l(p,c.to,c,f)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(u):u(c);return a}gapSize(t,n,r,i){let o=lm(i,r)-lm(i,n);return this.heightOracle.lineWrapping?t.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(t){Jx.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=he.set(t.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];Pe.spans(n,this.viewport.from,this.viewport.to,{span(o,s){r.push({from:o,to:s})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let o=0;o<r.length&&!(i&8);o++){let s=this.visibleRanges[o],a=r[o];(s.from!=a.from||s.to!=a.to)&&(i|=4,t&&t.mapPos(s.from,-1)==a.from&&t.mapPos(s.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||jf(this.heightMap.lineAt(t,tt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||jf(this.heightMap.lineAt(this.scaler.fromDOM(t),tt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return jf(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class sm{constructor(t,n){this.from=t,this.to=n}}function NMe(e,t,n){let r=[],i=e,o=0;return Pe.spans(n,e,t,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i<t&&(r.push({from:i,to:t}),o+=t-i),{total:o,ranges:r}}function am({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:o,to:s}=t[i],a=s-o;if(r<=a)return o+r;r-=a}}function lm(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function DMe(e,t){for(let n of e)if(t(n))return n}const qR={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function KR(e){let t=e.facet(G0).filter(r=>typeof r!="function"),n=e.facet(OP).filter(r=>typeof r!="function");return n.length&&t.push(Pe.join(n)),t}class EP{constructor(t,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let u=n.lineAt(a,tt.ByPos,t,0,0).top,c=n.lineAt(l,tt.ByPos,t,0,0).bottom;return i+=c-u,{from:a,to:l,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.top)return i+(t-r)*this.scale;if(t<=o.bottom)return o.domTop+(t-o.top);r=o.bottom,i=o.domBottom}}fromDOM(t){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.domTop)return r+(t-i)/this.scale;if(t<=o.domBottom)return o.top+(t-o.domTop);r=o.bottom,i=o.domBottom}}eq(t){return t instanceof EP?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((n,r)=>n.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function jf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new li(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>jf(i,t)):e._content)}const um=se.define({combine:e=>e.join(" ")}),tO=se.define({combine:e=>e.indexOf(!0)>-1}),nO=Ts.newName(),I6=Ts.newName(),j6=Ts.newName(),R6={"&light":"."+I6,"&dark":"."+j6};function rO(e,t,n){return new Ts(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const LMe=rO("."+nO,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},R6),$Me={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},e1=oe.ie&&oe.ie_version<=11;class BMe{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new m2e,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(oe.ie&&oe.ie_version<=11||oe.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&oe.android&&t.constructor.EDIT_CONTEXT!==!1&&!(oe.chrome&&oe.chrome_version<126)&&(this.editContext=new zMe(t),t.state.facet(lo)&&(t.contentDOM.editContext=this.editContext.editContext)),e1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(lo)?r.root.activeElement!=this.dom:!rh(this.dom,i))return;let o=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(oe.ie&&oe.ie_version<=11||oe.android&&oe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&oh(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=Ad(t.root);if(!n)return!1;let r=oe.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&FMe(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=rh(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&y2e(this.dom,r)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,n){this.selectionRange.set(t.node,t.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&t<this.scrollTargets.length&&this.scrollTargets[t]==r?t++:n||(n=this.scrollTargets.slice(0,t)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(t<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,t)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,$Me),e1&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),e1&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&xu(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of t){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&rh(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new iMe(this.view,t,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=w6(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!Zy(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let r=GR(n,t.previousSibling||t.target.previousSibling,-1),i=GR(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(lo)!=t.state.facet(lo)&&(t.view.contentDOM.editContext=t.state.facet(lo)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function GR(e,t,n){for(;t;){let r=kt.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function QR(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return oh(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function FMe(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return QR(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?QR(e,n):null}class zMe{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:o,head:s}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let u=l-a>r.text.length;a==this.from&&o<this.from?a=o:l==this.to&&o>this.to&&(l=o);let c=S6(t.state.sliceDoc(a,l),r.text,(u?i.from:i.to)-a,u?"end":null);if(!c){let h=V.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Zy(h,i)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:c.from+a,to:c.toA+a,insert:Me.of(r.text.slice(c.from,c.toB).split(`
412
+ `))};if((oe.mac||oe.android)&&f.from==s-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Me.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);AP(t,f,V.single(this.toEditorPos(r.selectionStart,h),this.toEditorPos(r.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),f.from<f.to&&!f.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s<a;s++){let l=t.coordsForChar(s);o=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||o||new DOMRect,i.push(o)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let l=this.toEditorPos(o.rangeStart),u=this.toEditorPos(o.rangeEnd);if(l<u){let c=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(he.mark({attributes:{style:c}}).range(l,u))}}}t.dispatch({effects:h6.of(he.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Ad(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((o,s,a,l,u)=>{if(r)return;let c=u.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(u)){i=this.pendingContextChange=null,n+=c,this.to+=c;return}else i=null,this.revertPending(t.state);if(o+=n,s+=n,s<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||s>this.to||this.to-this.from+u.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),u.toString()),this.to+=c}n+=c}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to<t.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class ie{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||g2e(t.parent)||document,this.viewState=new VR(this,t.state||_e.create(t)),t.scrollTo&&t.scrollTo.is(rm)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(eu).map(i=>new Gx(i));for(let i of this.plugins)i.update(this);this.observer=new BMe(this),this.inputState=new lMe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new IR(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Vt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let h of t){if(h.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=h.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;t.some(h=>h.annotation(E6))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=T6(o,s),l||(a=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(_e.phrases)!=this.state.facet(_e.phrases))return this.setState(o);i=Qy.create(this,o,t),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of t){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:d}=h.state.selection,{x:p,y:m}=this.state.facet(ie.cursorScrollMargin);f=new wu(d.empty?d:V.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",m,p)}for(let d of h.effects)d.is(rm)&&(f=d.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=ev.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(If)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(um)!=i.state.facet(um)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let h of this.state.facet(Xk))try{h(i)}catch(d){Kn(this.state,d,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!w6(this,c)&&u.force&&xu(this.contentDOM,u.key,u.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new VR(this,t),this.plugins=t.facet(eu).map(r=>new Gx(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new IR(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(eu),r=t.state.facet(eu);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new Gx(o));else{let a=this.plugins[s];a.mustUpdate=t,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=t&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Kn(this.state,r,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(Q8(r||this.win))o=-1,s=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);o=d.from,s=d.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];l&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(d=>{try{return d.read(this)}catch(p){return Kn(this.state,p),XR}}),f=Qy.create(this,this.state,[]),h=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f),h&&this.docViewUpdate());for(let d=0;d<u.length;d++)if(c[d]!=XR)try{let p=u[d];p.write&&p.write(c[d],this)}catch(p){Kn(this.state,p)}if(h&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let p=((o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s)/this.scaleY;if((p>1||p<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Xk))a(n)}get themeClasses(){return nO+" "+(this.state.facet(tO)?j6:I6)+" "+this.state.facet(um)}updateAttrs(){let t=YR(this,d6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(lo)?"true":"false",class:"cm-content",style:`${oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),YR(this,kP,n);let r=this.observer.ignore(()=>{let i=AR(this.contentDOM,this.contentAttrs,n),o=AR(this.dom,this.editorAttrs,t);return i||o});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(ie.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(If);let t=this.state.facet(ie.cspNonce);Ts.mount(this.root,this.styleModules.concat(LMe).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key){this.measureRequests[n]=t;return}}this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(n===void 0||n&&n.plugin!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return Zx(this,t,jR(this,t,n,r))}moveByGroup(t,n){return Zx(this,t,jR(this,t,n,r=>Z2e(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),o=r[n?r.length-1:0];return V.cursor(o.side(n,i)+t.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return Y2e(this,t,n,r)}moveVertically(t,n,r){return Zx(this,t,J2e(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=Jk(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),Jk(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(t),o=this.bidiSpans(i),s=o[Ni.find(o,t-i.from,-1,n)];return Pd(r,s.dir==Ye.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(u6)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>WMe)return t6(t.length);let n=this.textDirectionAt(t.from),r;for(let o of this.bidiCache)if(o.from==t.from&&o.dir==n&&(o.fresh||e6(o.isolates,r=TR(this,t))))return o.order;r||(r=TR(this,t));let i=O2e(t.text,n,r);return this.bidiCache.push(new ev(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||oe.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{G8(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var r,i,o,s;return rm.of(new wu(typeof t=="number"?V.cursor(t):t,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(o=n.yMargin)!==null&&o!==void 0?o:5,(s=n.xMargin)!==null&&s!==void 0?s:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return rm.of(new wu(V.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ot.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ot.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Ts.newName(),i=[um.of(r),If.of(rO(`.${r}`,t))];return n&&n.dark&&i.push(tO.of(!0)),i}static baseTheme(t){return hl.lowest(If.of(rO("."+nO,t,R6)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&kt.get(r)||kt.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}ie.styleModule=If;ie.inputHandler=a6;ie.clipboardInputFilter=wP;ie.clipboardOutputFilter=SP;ie.scrollHandler=f6;ie.focusChangeEffect=l6;ie.perLineTextDirection=u6;ie.exceptionSink=s6;ie.updateListener=Xk;ie.editable=lo;ie.mouseSelectionStyle=o6;ie.dragMovesSelection=i6;ie.clickAddsSelectionRange=r6;ie.decorations=G0;ie.blockWrappers=p6;ie.outerDecorations=OP;ie.atomicRanges=sp;ie.bidiIsolatedRanges=m6;ie.cursorScrollMargin=se.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r=="number"?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}});ie.scrollMargins=g6;ie.darkTheme=tO;ie.cspNonce=se.define({combine:e=>e.length?e[0]:""});ie.contentAttributes=kP;ie.editorAttributes=d6;ie.lineWrapping=ie.contentAttributes.of({class:"cm-lineWrapping"});ie.announce=ke.define();const WMe=4096,XR={};class ev{constructor(t,n,r,i,o,s){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(t,n){if(n.empty&&!t.some(o=>o.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:Ye.LTR;for(let o=Math.max(0,t.length-10);o<t.length;o++){let s=t[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new ev(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function YR(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(e):o;s&&vP(s,n)}return n}const UMe=oe.mac?"mac":oe.windows?"win":oe.linux?"linux":"key";function HMe(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;l<n.length-1;++l){const u=n[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))i=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))t=="mac"?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function cm(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}const VMe=hl.default(ie.domEventHandlers({keydown(e,t){return D6(N6(t.state),e,t,"editor")}})),Z0=se.define({enables:VMe}),ZR=new WeakMap;function N6(e){let t=e.facet(Z0),n=ZR.get(t);return n||ZR.set(t,n=GMe(t.reduce((r,i)=>r.concat(i),[]))),n}function qMe(e,t,n){return D6(N6(e.state),t,e,n)}let Zo=null;const KMe=4e3;function GMe(e,t=UMe){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,u,c)=>{var f,h;let d=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(g=>HMe(g,t));for(let g=1;g<p.length;g++){let v=p.slice(0,g).join(" ");i(v,!0),d[v]||(d[v]={preventDefault:!0,stopPropagation:!1,run:[x=>{let k=Zo={view:x,prefix:v,scope:s};return setTimeout(()=>{Zo==k&&(Zo=null)},KMe),!0}]})}let m=p.join(" ");i(m,!1);let y=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((h=(f=d._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});l&&y.run.push(l),u&&(y.preventDefault=!0),c&&(y.stopPropagation=!0)};for(let s of e){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of a){let c=n[u]||(n[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let h in c)c[h].run.push(d=>f(d,iO))}let l=s[t]||s.key;if(l)for(let u of a)o(u,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(u,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let iO=null;function D6(e,t,n,r){iO=t;let i=u2e(t),o=Fn(i,0),s=Ii(o)==i.length&&i!=" ",a="",l=!1,u=!1,c=!1;Zo&&Zo.view==n&&Zo.scope==r&&(a=Zo.prefix+" ",O6.indexOf(t.keyCode)<0&&(u=!0,Zo=null));let f=new Set,h=y=>{if(y){for(let g of y.run)if(!f.has(g)&&(f.add(g),g(n)))return y.stopPropagation&&(c=!0),!0;y.preventDefault&&(y.stopPropagation&&(c=!0),u=!0)}return!1},d=e[r],p,m;return d&&(h(d[a+cm(i,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(oe.windows&&t.ctrlKey&&t.altKey)&&!(oe.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=_s[t.keyCode])&&p!=i?(h(d[a+cm(p,t,!0)])||t.shiftKey&&(m=Od[t.keyCode])!=i&&m!=p&&h(d[a+cm(m,t,!1)]))&&(l=!0):s&&t.shiftKey&&h(d[a+cm(i,t,!0)])&&(l=!0),!l&&h(d._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),iO=null,l}class ja{constructor(t,n,r,i,o){this.className=t,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=L6(t);return[new ja(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return QMe(t,n,r)}}function L6(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Ye.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function JR(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function QMe(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==Ye.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=L6(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),h=a.right-(c?parseInt(c.paddingRight):0),d=Zk(e,r,1),p=Zk(e,i,-1),m=d.type==fn.Text?d:null,y=p.type==fn.Text?p:null;if(m&&(e.lineWrapping||d.widgetLineBreaks)&&(m=JR(e,r,1,m)),y&&(e.lineWrapping||p.widgetLineBreaks)&&(y=JR(e,i,-1,y)),m&&y&&m.from==y.from&&m.to==y.to)return v(x(n.from,n.to,m));{let w=m?x(n.from,null,m):k(d,!1),S=y?x(null,n.to,y):k(p,!0),O=[];return(m||d).to<(y||p).from-(m&&y?1:0)||d.widgetLineBreaks>1&&w.bottom+e.defaultLineHeight/2<S.top?O.push(g(f,w.bottom,h,S.top)):w.bottom<S.top&&e.elementAtHeight((w.bottom+S.top)/2).type==fn.Text&&(w.bottom=S.top=(w.bottom+S.top)/2),v(w).concat(O).concat(v(S))}function g(w,S,O,A){return new ja(t,w-l.left,S-l.top,Math.max(0,O-w),A-S)}function v({top:w,bottom:S,horizontal:O}){let A=[];for(let P=0;P<O.length;P+=2)A.push(g(O[P],w,O[P+1],S));return A}function x(w,S,O){let A=1e9,P=-1e9,M=[];function _(N,j,B,F,$){let z=e.coordsAtPos(N,N==O.to?-2:2),T=e.coordsAtPos(B,B==O.from?2:-2);!z||!T||(A=Math.min(z.top,T.top,A),P=Math.max(z.bottom,T.bottom,P),$==Ye.LTR?M.push(o&&j?f:z.left,o&&F?h:T.right):M.push(!o&&F?f:T.left,!o&&j?h:z.right))}let E=w??O.from,R=S??O.to;for(let N of e.visibleRanges)if(N.to>E&&N.from<R)for(let j=Math.max(N.from,E),B=Math.min(N.to,R);;){let F=e.state.doc.lineAt(j);for(let $ of e.bidiSpans(F)){let z=$.from+F.from,T=$.to+F.from;if(z>=B)break;T>j&&_(Math.max(z,j),w==null&&z<=E,Math.min(T,B),S==null&&T>=R,$.dir)}if(j=F.to+1,j>=B)break}return M.length==0&&_(E,w==null,R,S==null,e.textDirection),{top:A,bottom:P,horizontal:M}}function k(w,S){let O=a.top+(S?w.top:w.bottom);return{top:O,bottom:O,horizontal:[]}}}function XMe(e,t){return e.constructor==t.constructor&&e.eq(t)}class YMe{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(Gm)!=t.state.facet(Gm)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(Gm);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:n}=this.view;(t!=this.scaleX||n!=this.scaleY)&&(this.scaleX=t,this.scaleY=n,this.dom.style.transform=`scale(${1/t}, ${1/n})`)}draw(t){if(t.length!=this.drawn.length||t.some((n,r)=>!XMe(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Gm=se.define();function $6(e){return[Ot.define(t=>new YMe(t,e)),Gm.of(e)]}const dc=se.define({combine(e){return Zi(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function ZMe(e={}){return[dc.of(e),JMe,eIe,tIe,c6.of(!0)]}function B6(e){return e.startState.facet(dc)!=e.state.facet(dc)}const JMe=$6({above:!0,markers(e){let{state:t}=e,n=t.facet(dc),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(o&&oe.ios&&n.iosSelectionHandles)){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:V.cursor(i.head,i.assoc);for(let l of ja.forRange(e,s,a))r.push(l)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=B6(e);return n&&eN(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){eN(t.state,e)},class:"cm-cursorLayer"});function eN(e,t){t.style.animationDuration=e.facet(dc).cursorBlinkRate+"ms"}const eIe=$6({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty)for(let o of ja.forRange(e,"cm-selectionBackground",i))t.push(o);if(oe.ios&&!n.empty&&e.state.facet(dc).iosSelectionHandles){for(let i of ja.forRange(e,"cm-selectionHandle cm-selectionHandle-start",V.cursor(n.from,1)))t.push(i);for(let i of ja.forRange(e,"cm-selectionHandle cm-selectionHandle-end",V.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||B6(e)},class:"cm-selectionLayer"}),tIe=hl.highest(ie.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),F6=ke.define({map(e,t){return e==null?null:t.mapPos(e)}}),Rf=kn.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(F6)?r.value:n,e)}}),nIe=Ot.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Rf);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Rf)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Rf),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Rf)!=e&&this.view.dispatch({effects:F6.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function rIe(){return[Rf,nIe]}function tN(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}function iIe(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class oIe{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,u,c)=>i(c,u,u+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,u,c)=>{let f=r(a,l,u);f&&c(u,u+a[0].length,f)};else if(r)this.addMatch=(a,l,u,c)=>c(u,u+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(t){let n=new _o,r=n.add.bind(n);for(let{from:i,to:o}of iIe(t,this.maxLength))tN(t.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,t,s,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((o,s,a,l)=>{l>=t.view.viewport.from&&a<=t.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let o of t.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>=s){let l=t.state.doc.lineAt(s),u=l.to<a?t.state.doc.lineAt(a):l,c=Math.max(o.from,l.from),f=Math.min(o.to,u.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){c=s;break}for(;a<u.to;a++)if(this.boundary.test(u.text[a-u.from])){f=a;break}}let h=[],d,p=(m,y,g)=>h.push(g.range(m,y));if(l==u)for(this.regexp.lastIndex=c-l.from;(d=this.regexp.exec(l.text))&&d.index<f-l.from;)this.addMatch(d,t,d.index+l.from,p);else tN(t.state.doc,this.regexp,c,f,(m,y)=>this.addMatch(y,t,m,p));n=n.update({filterFrom:c,filterTo:f,filter:(m,y)=>m<c||y>f,add:h})}}return n}}const oO=/x/.unicode!=null?"gu":"g",sIe=new RegExp(`[\0-\b
413
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,oO),aIe={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let t1=null;function lIe(){var e;if(t1==null&&typeof document<"u"&&document.body){let t=document.body.style;t1=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return t1||!1}const Qm=se.define({combine(e){let t=Zi(e,{render:null,specialChars:sIe,addSpecialChars:null});return(t.replaceTabs=!lIe())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,oO)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,oO)),t}});function uIe(e={}){return[Qm.of(e),cIe()]}let nN=null;function cIe(){return nN||(nN=Ot.fromClass(class{constructor(e){this.view=e,this.decorations=he.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Qm)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new oIe({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=Fn(t[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=Bc(s.text,a,r-s.from);return he.replace({widget:new pIe((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=he.replace({widget:new dIe(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Qm);e.startState.facet(Qm)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const fIe="•";function hIe(e){return e>=32?fIe:e==10?"␤":String.fromCharCode(9216+e)}class dIe extends Ji{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=hIe(this.code),r=t.state.phrase("Control character")+" "+(aIe[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class pIe extends Ji{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function mIe(){return yIe}const gIe=he.line({class:"cm-activeLine"}),yIe=Ot.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(gIe.range(i.from)),t=i.from)}return he.set(n)}},{decorations:e=>e.decorations});class vIe extends Ji{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?ih(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=Pd(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function bIe(e){let t=Ot.fromClass(class{constructor(n){this.view=n,this.placeholder=e?he.set([he.widget({widget:new vIe(e),side:1}).range(0)]):he.none}get decorations(){return this.view.state.doc.length?he.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,ie.contentAttributes.of({"aria-placeholder":e})]:t}const sO=2e3;function xIe(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>sO||n.off>sO||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let l=r;l<=i;l++){let u=e.doc.line(l);u.length<=a&&o.push(V.range(u.from+s,u.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let l=r;l<=i;l++){let u=e.doc.line(l),c=Bk(u.text,s,e.tabSize,!0);if(c<0)o.push(V.cursor(u.to));else{let f=Bk(u.text,a,e.tabSize);o.push(V.range(u.from+c,u.from+f))}}}return o}function wIe(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function rN(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>sO?-1:i==r.length?wIe(e,t.clientX):Bc(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function SIe(e,t){let n=rN(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=rN(e,i);if(!a)return r;let l=xIe(e.state,n,a);return l.length?s?V.create(l.concat(r.ranges)):V.create(l):r}}:null}function kIe(e){let t=n=>n.altKey&&n.button==0;return ie.mouseSelectionStyle.of((n,r)=>t(r)?SIe(n,r):null)}const OIe={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},CIe={style:"cursor: crosshair"};function AIe(e={}){let[t,n]=OIe[e.key||"Alt"],r=Ot.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,ie.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?CIe:null})]}const fm="-10000px";class z6{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(t,n){var r;let i=t.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(t);return!1}let s=[],a=n?[]:null;for(let l=0;l<o.length;l++){let u=o[l],c=-1;if(u){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==u.create&&(c=f)}if(c<0)s[l]=this.createTooltipView(u,l?s[l-1]:null),a&&(a[l]=!!u.above);else{let f=s[l]=this.tooltipViews[c];a&&(a[l]=n[c]),f.update&&f.update(t)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,u)=>n[u]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function PIe(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const n1=se.define({combine:e=>{var t,n,r;return{position:oe.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||PIe}}}),iN=new WeakMap,TP=Ot.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(n1);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new z6(e,_P,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(n1);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=fm,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(oe.safari){let s=o.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}else n=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(e=o.width/this.parent.offsetWidth,t=o.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=CP(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,s)=>{let a=this.manager.tooltipViews[s];return a.getCoords?a.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(n1).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],u=this.manager.tooltipViews[a],{dom:c}=u,f=e.pos[a],h=e.size[a];if(!f||l.clip!==!1&&(f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1)){c.style.top=fm;continue}let d=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=h.right-h.left,y=(t=iN.get(u))!==null&&t!==void 0?t:h.bottom-h.top,g=u.offset||TIe,v=this.view.textDirection==Ye.LTR,x=h.width>r.right-r.left?v?r.left:r.right-h.width:v?Math.max(r.left,Math.min(f.left-(d?14:0)+g.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(d?14:0)-g.x),r.right-m),k=this.above[a];!l.strictSide&&(k?f.top-y-p-g.y<r.top:f.bottom+y+p+g.y>r.bottom)&&k==r.bottom-f.bottom>f.top-r.top&&(k=this.above[a]=!k);let w=(k?f.top-r.top:r.bottom-f.bottom)-p;if(w<y&&u.resize!==!1){if(w<this.view.defaultLineHeight){c.style.top=fm;continue}iN.set(u,y),c.style.height=(y=w)/o+"px"}else c.style.height&&(c.style.height="");let S=k?f.top-y-p-g.y:f.bottom+p+g.y,O=x+m;if(u.overlap!==!0)for(let A of s)A.left<O&&A.right>x&&A.top<S+y&&A.bottom>S&&(S=k?A.top-y-2-p:A.bottom+p+2);if(this.position=="absolute"?(c.style.top=(S-e.parent.top)/o+"px",oN(c,(x-e.parent.left)/i)):(c.style.top=S/o+"px",oN(c,x/i)),d){let A=f.left+(v?g.x:-g.x)-(x+14-7);d.style.left=A/i+"px"}u.overlap!==!0&&s.push({left:x,top:S,right:O,bottom:S+y}),c.classList.toggle("cm-tooltip-above",k),c.classList.toggle("cm-tooltip-below",!k),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=fm}},{eventObservers:{scroll(){this.maybeMeasure()}}});function oN(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const EIe=ie.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),TIe={x:0,y:0},_P=se.define({enables:[TP,EIe]}),tv=se.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class J0{static create(t){return new J0(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new z6(t,tv,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const _Ie=_P.compute([tv],e=>{let t=e.facet(tv);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:J0.create,above:t[0].above,arrow:t.some(n=>n.arrow)}});class MIe{constructor(t,n,r,i,o){this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:n}=this,r=t.docView.tile.nearest(n.target);if(!r)return;let i,o=1;if(r.isWidget())i=r.posAtStart;else{if(i=t.posAtCoords(n),i==null)return;let a=t.coordsAtPos(i);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-t.defaultCharacterWidth||n.x>a.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=l&&l.dir==Ye.RTL?-1:1;o=n.x<a.left?-u:u}let s=this.source(t,i,o);if(s?.then){let a=this.pending={pos:i};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Kn(t.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(TP),n=t?t.manager.tooltips.findIndex(r=>r.create==J0.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!IIe(o.dom,t)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!jIe(this.view,s,a,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const hm=4;function IIe(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let a=s.getBoundingClientRect();i=Math.min(a.top,i),o=Math.max(a.bottom,o)}return t.clientX>=n-hm&&t.clientX<=r+hm&&t.clientY>=i-hm&&t.clientY<=o+hm}function jIe(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=e.posAtCoords({x:r,y:i},!1);return l>=t&&l<=n}function RIe(e,t={}){let n=ke.define(),r=kn.define({create(){return[]},update(i,o){if(i.length&&(t.hideOnChange&&(o.docChanged||o.selection)?i=[]:t.hideOn&&(i=i.filter(s=>!t.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,_n.TrackDel);if(l!=null){let u=Object.assign(Object.create(null),a);u.pos=l,u.end!=null&&(u.end=o.changes.mapPos(u.end)),s.push(u)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(NIe)&&(i=[]);return i},provide:i=>tv.from(i)});return{active:r,extension:[r,Ot.define(i=>new MIe(i,e,r,n,t.hoverTime||300)),_Ie]}}function W6(e,t){let n=e.plugin(TP);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const NIe=ke.define(),sN=se.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function MP(e,t){let n=e.plugin(U6),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const U6=Ot.fromClass(class{constructor(e){this.input=e.state.facet(Td),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(sN);this.top=new dm(e,!0,t.topContainer),this.bottom=new dm(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(sN);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new dm(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new dm(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Td);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let u=this.specs.indexOf(l),c;u<0?(c=l(e.view),a.push(c)):(c=this.panels[u],c.update&&c.update(e)),i.push(c),(c.top?o:s).push(c)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>ie.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class dm{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=aN(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=aN(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function aN(e){let t=e.nextSibling;return e.remove(),t}const Td=se.define({enables:U6});function DIe(e,t){let n,r=new Promise(s=>n=s),i=s=>LIe(s,t,n);e.state.field(r1,!1)?e.dispatch({effects:H6.of(i)}):e.dispatch({effects:ke.appendConfig.of(r1.init(()=>[i]))});let o=V6.of(i);return{close:o,result:r.then(s=>((e.win.queueMicrotask||(l=>e.win.setTimeout(l,10)))(()=>{e.state.field(r1).indexOf(i)>-1&&e.dispatch({effects:o})}),s))}}const r1=kn.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(H6)?e=[n.value].concat(e):n.is(V6)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>Td.computeN([e],t=>t.field(e))}),H6=ke.define(),V6=ke.define();function LIe(e,t,n){let r=t.content?t.content(e,()=>s(null)):null;if(!r){if(r=Ue("form"),t.input){let a=Ue("input",t.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(Ue("label",(t.label||"")+": ",a))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Ue("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<i.length;a++){let l=i[a];l.addEventListener("keydown",u=>{u.keyCode==27?(u.preventDefault(),s(null)):u.keyCode==13&&(u.preventDefault(),s(l))}),l.addEventListener("submit",u=>{u.preventDefault(),s(l)})}let o=Ue("div",r,Ue("button",{onclick:()=>s(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(o.className=t.class),o.classList.add("cm-dialog");function s(a){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(a)}return{dom:o,top:t.top,mount:()=>{if(t.focus){let a;typeof t.focus=="string"?a=r.querySelector(t.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class Io extends Es{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Io.prototype.elementClass="";Io.prototype.toDOM=void 0;Io.prototype.mapMode=_n.TrackBefore;Io.prototype.startSide=Io.prototype.endSide=-1;Io.prototype.point=!0;const Xm=se.define(),$Ie=se.define(),BIe={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Pe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},ah=se.define();function FIe(e){return[q6(),ah.of({...BIe,...e})]}const lN=se.define({combine:e=>e.some(t=>t)});function q6(e){return[zIe]}const zIe=Ot.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(ah).map(t=>new cN(e,t)),this.fixed=!e.state.facet(lN);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(lN)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=Pe.iter(this.view.state.facet(Xm),this.view.viewport.from),r=[],i=this.gutters.map(o=>new WIe(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==fn.Text&&s){aO(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==fn.Text){aO(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(ah),n=e.state.facet(ah),r=e.docChanged||e.heightChanged||e.viewportChanged||!Pe.eq(e.startState.facet(Xm),e.state.facet(Xm),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=t.indexOf(o);s<0?i.push(new cN(this.view,o)):(this.gutters[s].update(e),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>ie.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Ye.LTR?{left:r,right:i}:{right:r,left:i}})});function uN(e){return Array.isArray(e)?e:[e]}function aO(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class WIe{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=Pe.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,o=(n.top-this.height)/t.scaleY,s=n.height/t.scaleY;if(this.i==i.elements.length){let a=new K6(t,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(t,s,o,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];aO(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(t,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n),i=r?[r]:null;for(let o of t.state.facet($Ie)){let s=o(t,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(t,n,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class cN{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=t.lineBlockAtHeight(s-t.documentTop);n.domEventHandlers[r](t,a,i)&&i.preventDefault()});this.markers=uN(n.markers(t)),n.initialSpacer&&(this.spacer=new K6(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=uN(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!Pe.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class K6{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),UIe(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=o<n.length?n[o++]:null,u=!1;if(l){let c=l.elementClass;c&&(r+=" "+c);for(let f=s;f<this.markers.length;f++)if(this.markers[f].compare(l)){a=f,u=!0;break}}else a=this.markers.length;for(;s<a;){let c=this.markers[s++];if(c.toDOM){c.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!l)break;l.toDOM&&(u?i=i.nextSibling:this.dom.insertBefore(l.toDOM(t),i)),u&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function UIe(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}const HIe=se.define(),VIe=se.define(),tu=se.define({combine(e){return Zi(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,n){let r=Object.assign({},t);for(let i in n){let o=r[i],s=n[i];r[i]=o?(a,l,u)=>o(a,l,u)||s(a,l,u):s}return r}})}});class i1 extends Io{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function o1(e,t){return e.state.facet(tu).formatNumber(t,e.state)}const qIe=ah.compute([tu],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(HIe)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new i1(o1(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(VIe)){let o=i(t,n,r);if(o)return o}return null},lineMarkerChange:t=>t.startState.facet(tu)!=t.state.facet(tu),initialSpacer(t){return new i1(o1(t,fN(t.state.doc.lines)))},updateSpacer(t,n){let r=o1(n.view,fN(n.view.state.doc.lines));return r==t.number?t:new i1(r)},domEventHandlers:e.facet(tu).domEventHandlers,side:"before"}));function KIe(e={}){return[tu.of(e),q6(),qIe]}function fN(e){let t=9;for(;t<e;)t=t*10+9;return t}const GIe=new class extends Io{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},QIe=Xm.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(GIe.range(i)))}return Pe.of(t)});function XIe(){return QIe}const G6=1024;let YIe=0;class s1{constructor(t,n){this.from=t,this.to=n}}class Ae{constructor(t={}){this.id=YIe++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=tr.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}Ae.closedBy=new Ae({deserialize:e=>e.split(" ")});Ae.openedBy=new Ae({deserialize:e=>e.split(" ")});Ae.group=new Ae({deserialize:e=>e.split(" ")});Ae.isolate=new Ae({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Ae.contextHash=new Ae({perNode:!0});Ae.lookAhead=new Ae({perNode:!0});Ae.mounted=new Ae({perNode:!0});class lh{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[Ae.mounted.id]}}const ZIe=Object.create(null);class tr{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):ZIe,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new tr(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Ae.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(Ae.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}tr.none=new tr("",Object.create(null),0,8);class IP{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let o of t){let s=o(r);if(s){i||(i=Object.assign({},r.props));let a=s[1],l=s[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}n.push(i?new tr(r.name,i,r.id,r.flags):r)}return new IP(n)}}const pm=new WeakMap,hN=new WeakMap;var St;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(St||(St={}));class Tt{constructor(t,n,r,i,o){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let t=lh.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new uO(this.topNode,t)}cursorAt(t,n=0,r=0){let i=pm.get(this)||this.topNode,o=new uO(i);return o.moveTo(t,n),pm.set(this,o._tree),o}get topNode(){return new Hr(this,0,0,null)}resolve(t,n=0){let r=_d(pm.get(this)||this.topNode,t,n,!1);return pm.set(this,r),r}resolveInner(t,n=0){let r=_d(hN.get(this)||this.topNode,t,n,!0);return hN.set(this,r),r}resolveStack(t,n=0){return tje(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:o=this.length}=t,s=t.mode||0,a=(s&St.IncludeAnonymous)>0;for(let l=this.cursor(s|St.IncludeAnonymous);;){let u=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;u=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:NP(tr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Tt(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new Tt(tr.none,n,r,i)))}static build(t){return nje(t)}}Tt.empty=new Tt(tr.none,[],[],0);class jP{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new jP(this.buffer,this.index)}}class Is{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return tr.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),t+=4,r==t)return o;let s=[];for(;t<r;)s.push(this.childString(t)),t=this.buffer[t+3];return o+"("+s.join(",")+")"}findChild(t,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=t;l!=n&&!(Q6(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let u=o[l++]=i[a++]-r;o[l++]=i[a++]-t,s=Math.max(s,u)}return new Is(o,s,this.set)}}function Q6(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function _d(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let s=!r&&e instanceof Hr&&e.index<0?null:e.parent;if(!s)return e;e=s}let o=r?0:St.IgnoreOverlays;if(r)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof Hr&&s.index<0&&((i=a.enter(t,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(e=a);for(;;){let s=e.enter(t,n,o);if(!s)return e;e=s}}class X6{cursor(t=0){return new uO(this,t)}getChild(t,n=null,r=null){let i=dN(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return dN(this,t,n,r)}resolve(t,n=0){return _d(this,t,n,!1)}resolveInner(t,n=0){return _d(this,t,n,!0)}matchContext(t){return lO(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Hr extends X6{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,u=n>0?a.length:-1;t!=u;t+=n){let c=a[t],f=l[t]+s.from,h;if(!(!(o&St.EnterBracketed&&c instanceof Tt&&(h=lh.get(c))&&!h.overlay&&h.bracketed&&r>=f&&r<=f+c.length)&&!Q6(i,r,f,f+c.length))){if(c instanceof Is){if(o&St.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,n,r-f,i);if(d>-1)return new as(new JIe(s,c,t,f),null,d)}else if(o&St.IncludeAnonymous||!c.type.isAnonymous||RP(c)){let d;if(!(o&St.IgnoreMounts)&&(d=lh.get(c))&&!d.overlay)return new Hr(d.tree,f,t,s);let p=new Hr(c,f,t,s);return o&St.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?c.children.length-1:0,n,r,i,o)}}}if(o&St.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&St.IgnoreOverlays)&&(i=lh.get(this._tree))&&i.overlay){let o=t-this.from,s=r&St.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||s?a<=o:a<o)&&(n<0||s?l>=o:l>o))return new Hr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function dN(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function lO(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class JIe{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class as extends X6{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new as(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&St.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new as(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new as(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new as(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new Tt(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Y6(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;o<e.length;o++){let s=e[o];(s.from>n.from||s.to<n.to)&&(n=s,t=o)}let r=n instanceof Hr&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new eje(i,n)}class eje{constructor(t,n){this.heads=t,this.node=n}get next(){return Y6(this.heads)}}function tje(e,t,n){let r=e.resolveInner(t,n),i=null;for(let o=r instanceof Hr?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(t,n)),o=s}else{let s=lh.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let a=new Hr(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(_d(a,t,n,!1))}}return i?Y6(i):r}class uO{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~St.EnterBracketed,t instanceof Hr)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Hr?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&St.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&St.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&St.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&St.IncludeAnonymous||a instanceof Is||!a.type.isAnonymous||RP(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new as(this.buffer,n,this.stack[i]);return this.bufferNode=new as(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return lO(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return lO(this._tree,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function RP(e){return e.children.some(t=>t instanceof Is||!t.type.isAnonymous||RP(t))}function nje(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=G6,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new jP(n,n.length):n,l=r.types,u=0,c=0;function f(w,S,O,A,P,M){let{id:_,start:E,end:R,size:N}=a,j=c,B=u;if(N<0)if(a.next(),N==-1){let q=o[_];O.push(q),A.push(E-w);return}else if(N==-3){u=_;return}else if(N==-4){c=_;return}else throw new RangeError(`Unrecognized record size: ${N}`);let F=l[_],$,z,T=E-w;if(R-E<=i&&(z=y(a.pos-S,P))){let q=new Uint16Array(z.size-z.skip),D=a.pos-z.size,I=q.length;for(;a.pos>D;)I=g(z.start,q,I);$=new Is(q,R-z.start,r),T=z.start-w}else{let q=a.pos-N;a.next();let D=[],I=[],Y=_>=s?_:-1,G=0,te=R;for(;a.pos>q;)Y>=0&&a.id==Y&&a.size>=0?(a.end<=te-i&&(p(D,I,E,G,a.end,te,Y,j,B),G=D.length,te=a.end),a.next()):M>2500?h(E,q,D,I):f(E,q,D,I,Y,M+1);if(Y>=0&&G>0&&G<D.length&&p(D,I,E,G,E,te,Y,j,B),D.reverse(),I.reverse(),Y>-1&&G>0){let fe=d(F,B);$=NP(F,D,I,0,D.length,0,R-E,fe,fe)}else $=m(F,D,I,R-E,j-R,B)}O.push($),A.push(T)}function h(w,S,O,A){let P=[],M=0,_=-1;for(;a.pos>S;){let{id:E,start:R,end:N,size:j}=a;if(j>4)a.next();else{if(_>-1&&R<_)break;_<0&&(_=N-i),P.push(E,R,N),M++,a.next()}}if(M){let E=new Uint16Array(M*4),R=P[P.length-2];for(let N=P.length-3,j=0;N>=0;N-=3)E[j++]=P[N],E[j++]=P[N+1]-R,E[j++]=P[N+2]-R,E[j++]=j;O.push(new Is(E,P[2]-R,r)),A.push(R-w)}}function d(w,S){return(O,A,P)=>{let M=0,_=O.length-1,E,R;if(_>=0&&(E=O[_])instanceof Tt){if(!_&&E.type==w&&E.length==P)return E;(R=E.prop(Ae.lookAhead))&&(M=A[_]+E.length+R)}return m(w,O,A,P,M,S)}}function p(w,S,O,A,P,M,_,E,R){let N=[],j=[];for(;w.length>A;)N.push(w.pop()),j.push(S.pop()+O-P);w.push(m(r.types[_],N,j,M-P,E-M,R)),S.push(P-O)}function m(w,S,O,A,P,M,_){if(M){let E=[Ae.contextHash,M];_=_?[E].concat(_):[E]}if(P>25){let E=[Ae.lookAhead,P];_=_?[E].concat(_):[E]}return new Tt(w,S,O,A,_)}function y(w,S){let O=a.fork(),A=0,P=0,M=0,_=O.end-i,E={size:0,start:0,skip:0};e:for(let R=O.pos-w;O.pos>R;){let N=O.size;if(O.id==S&&N>=0){E.size=A,E.start=P,E.skip=M,M+=4,A+=4,O.next();continue}let j=O.pos-N;if(N<0||j<R||O.start<_)break;let B=O.id>=s?4:0,F=O.start;for(O.next();O.pos>j;){if(O.size<0)if(O.size==-3||O.size==-4)B+=4;else break e;else O.id>=s&&(B+=4);O.next()}P=F,A+=N,M+=B}return(S<0||A==w)&&(E.size=A,E.start=P,E.skip=M),E.size>4?E:void 0}function g(w,S,O){let{id:A,start:P,end:M,size:_}=a;if(a.next(),_>=0&&A<s){let E=O;if(_>4){let R=a.pos-(_-4);for(;a.pos>R;)O=g(w,S,O)}S[--O]=E,S[--O]=M-w,S[--O]=P-w,S[--O]=A}else _==-3?u=A:_==-4&&(c=A);return O}let v=[],x=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,v,x,-1,0);let k=(t=e.length)!==null&&t!==void 0?t:v.length?x[0]+v[0].length:0;return new Tt(l[e.topID],v.reverse(),x.reverse(),k)}const pN=new WeakMap;function Ym(e,t){if(!e.isAnonymous||t instanceof Is||t.type!=e)return 1;let n=pN.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Tt)){n=1;break}n+=Ym(e,r)}pN.set(t,n)}return n}function NP(e,t,n,r,i,o,s,a,l){let u=0;for(let p=r;p<i;p++)u+=Ym(e,t[p]);let c=Math.ceil(u*1.5/8),f=[],h=[];function d(p,m,y,g,v){for(let x=y;x<g;){let k=x,w=m[x],S=Ym(e,p[x]);for(x++;x<g;x++){let O=Ym(e,p[x]);if(S+O>=c)break;S+=O}if(x==k+1){if(S>c){let O=p[k];d(O.children,O.positions,0,O.children.length,m[k]+v);continue}f.push(p[k])}else{let O=m[x-1]+p[x-1].length-w;f.push(NP(e,p,m,k,x,w,O,null,l))}h.push(w+v-o)}}return d(t,n,r,i,0),(a||l)(f,h,s)}class Ra{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new Ra(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,u=0;;a++){let c=a<n.length?n[a]:null,f=c?c.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let h=s;if(l>=h.from||f<=h.to||u){let d=Math.max(h.from,l)-u,p=Math.min(h.to,f)-u;h=d>=p?null:new Ra(d,p,h.tree,h.offset+u,a>0,!!c)}if(h&&i.push(h),s.to>f)break;s=o<t.length?t[o++]:null}if(!c)break;l=c.toA,u=c.toA-c.toB}return i}}class Z6{startParse(t,n,r){return typeof t=="string"&&(t=new rje(t)),r=r?r.length?r.map(i=>new s1(i.from,i.to)):[new s1(0,0)]:[new s1(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}}class rje{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new Ae({perNode:!0});let ije=0,so=class cO{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=ije++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof cO&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new cO(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(t){let n=new nv(t);return r=>r.modified.indexOf(n)>-1?r:nv.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}},oje=0;class nv{constructor(t){this.name=t,this.instances=[],this.id=oje++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&sje(n,a.modified));if(r)return r;let i=[],o=new so(t.name,i,t,n);for(let a of n)a.instances.push(o);let s=aje(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(nv.get(a,l));return o}}function sje(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function aje(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function J6(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,u=o[l];if(!u)throw new RangeError("Invalid path: "+i);let c=new Md(r,s,l>0?o.slice(0,l):null);t[u]=c.sort(t[u])}}return e9.add(t)}const e9=new Ae({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new Md(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class Md{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}Md.empty=new Md([],2,null);function t9(e,t){let n=Object.create(null);for(let o of e)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=t||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let u=n[l.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function lje(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function uje(e,t,n,r=0,i=e.length){let o=new cje(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class cje{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let u=i,c=fje(t)||Md.empty,f=lje(o,c.tags);if(f&&(u&&(u+=" "),u+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),u),c.opaque)return;let h=t.tree&&t.tree.prop(Ae.mounted);if(h&&h.overlay){let d=t.node.enter(h.overlay[0].from+a,1),p=this.highlighters.filter(y=>!y.scope||y.scope(h.tree.type)),m=t.firstChild();for(let y=0,g=a;;y++){let v=y<h.overlay.length?h.overlay[y]:null,x=v?v.from+a:l,k=Math.max(n,g),w=Math.min(r,x);if(k<w&&m)for(;t.from<w&&(this.highlightRange(t,k,w,i,o),this.startSpan(Math.min(w,t.to),u),!(t.to>=x||!t.nextSibling())););if(!v||x>r)break;g=v.to+a,g>n&&(this.highlightRange(d.cursor(),Math.max(n,v.from+a),Math.min(r,g),"",p),this.startSpan(Math.min(r,g),u))}m&&t.parent()}else if(t.firstChild()){h&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),u)}while(t.nextSibling());t.parent()}}}function fje(e){let t=e.type.prop(e9);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const re=so.define,mm=re(),Go=re(),mN=re(Go),gN=re(Go),Qo=re(),gm=re(Qo),a1=re(Qo),Oi=re(),Js=re(Oi),Si=re(),ki=re(),fO=re(),xf=re(fO),ym=re(),W={comment:mm,lineComment:re(mm),blockComment:re(mm),docComment:re(mm),name:Go,variableName:re(Go),typeName:mN,tagName:re(mN),propertyName:gN,attributeName:re(gN),className:re(Go),labelName:re(Go),namespace:re(Go),macroName:re(Go),literal:Qo,string:gm,docString:re(gm),character:re(gm),attributeValue:re(gm),number:a1,integer:re(a1),float:re(a1),bool:re(Qo),regexp:re(Qo),escape:re(Qo),color:re(Qo),url:re(Qo),keyword:Si,self:re(Si),null:re(Si),atom:re(Si),unit:re(Si),modifier:re(Si),operatorKeyword:re(Si),controlKeyword:re(Si),definitionKeyword:re(Si),moduleKeyword:re(Si),operator:ki,derefOperator:re(ki),arithmeticOperator:re(ki),logicOperator:re(ki),bitwiseOperator:re(ki),compareOperator:re(ki),updateOperator:re(ki),definitionOperator:re(ki),typeOperator:re(ki),controlOperator:re(ki),punctuation:fO,separator:re(fO),bracket:xf,angleBracket:re(xf),squareBracket:re(xf),paren:re(xf),brace:re(xf),content:Oi,heading:Js,heading1:re(Js),heading2:re(Js),heading3:re(Js),heading4:re(Js),heading5:re(Js),heading6:re(Js),contentSeparator:re(Oi),list:re(Oi),quote:re(Oi),emphasis:re(Oi),strong:re(Oi),link:re(Oi),monospace:re(Oi),strikethrough:re(Oi),inserted:re(),deleted:re(),changed:re(),invalid:re(),meta:ym,documentMeta:re(ym),annotation:re(ym),processingInstruction:re(ym),definition:so.defineModifier("definition"),constant:so.defineModifier("constant"),function:so.defineModifier("function"),standard:so.defineModifier("standard"),local:so.defineModifier("local"),special:so.defineModifier("special")};for(let e in W){let t=W[e];t instanceof so&&(t.name=e)}t9([{tag:W.link,class:"tok-link"},{tag:W.heading,class:"tok-heading"},{tag:W.emphasis,class:"tok-emphasis"},{tag:W.strong,class:"tok-strong"},{tag:W.keyword,class:"tok-keyword"},{tag:W.atom,class:"tok-atom"},{tag:W.bool,class:"tok-bool"},{tag:W.url,class:"tok-url"},{tag:W.labelName,class:"tok-labelName"},{tag:W.inserted,class:"tok-inserted"},{tag:W.deleted,class:"tok-deleted"},{tag:W.literal,class:"tok-literal"},{tag:W.string,class:"tok-string"},{tag:W.number,class:"tok-number"},{tag:[W.regexp,W.escape,W.special(W.string)],class:"tok-string2"},{tag:W.variableName,class:"tok-variableName"},{tag:W.local(W.variableName),class:"tok-variableName tok-local"},{tag:W.definition(W.variableName),class:"tok-variableName tok-definition"},{tag:W.special(W.variableName),class:"tok-variableName2"},{tag:W.definition(W.propertyName),class:"tok-propertyName tok-definition"},{tag:W.typeName,class:"tok-typeName"},{tag:W.namespace,class:"tok-namespace"},{tag:W.className,class:"tok-className"},{tag:W.macroName,class:"tok-macroName"},{tag:W.propertyName,class:"tok-propertyName"},{tag:W.operator,class:"tok-operator"},{tag:W.comment,class:"tok-comment"},{tag:W.meta,class:"tok-meta"},{tag:W.invalid,class:"tok-invalid"},{tag:W.punctuation,class:"tok-punctuation"}]);var l1;const nu=new Ae;function hje(e){return se.define({combine:e?t=>t.concat(e):void 0})}const dje=new Ae;class ci{constructor(t,n,r=[],i=""){this.data=t,this.name=i,_e.prototype.hasOwnProperty("tree")||Object.defineProperty(_e.prototype,"tree",{get(){return xn(this)}}),this.parser=n,this.extension=[js.of(this),_e.languageData.of((o,s,a)=>{let l=yN(o,s,a),u=l.type.prop(nu);if(!u)return[];let c=o.facet(u),f=l.type.prop(dje);if(f){let h=l.resolve(s-l.from,a);for(let d of f)if(d.test(h,o)){let p=o.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(t,n,r=-1){return yN(t,n,r).type.prop(nu)==this.data}findRegions(t){let n=t.facet(js);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(nu)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Ae.mounted);if(a){if(a.tree.prop(nu)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let u=o.children[l];u instanceof Tt&&i(u,o.positions[l]+s)}};return i(xn(t),0),r}get allowsNesting(){return!0}}ci.setState=ke.define();function yN(e,t,n){let r=e.facet(js),i=xn(e).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(t,n,St.ExcludeBuffers|St.EnterBracketed))o.type.isTop&&(i=o);return i}class rv extends ci{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=hje(t.languageData);return new rv(n,t.parser.configure({props:[nu.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new rv(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function xn(e){let t=e.field(ci.state,!1);return t?t.tree:Tt.empty}class pje{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t<r||n>=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let wf=null;class iv{constructor(t,n,r=[],i,o,s,a,l){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new iv(t,n,[],Tt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new pje(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Tt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Ra.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,n;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Ra.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=wf;wf=this;try{return t()}finally{wf=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=vN(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((u,c,f,h)=>l.push({fromA:u,toA:c,fromB:f,toB:h})),r=Ra.applyChanges(r,l),i=Tt.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){a=[];for(let u of this.skipped){let c=t.mapPos(u.from,1),f=t.mapPos(u.to,-1);c<f&&a.push({from:c,to:f})}}}return new iv(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<t.to&&o>t.from&&(this.fragments=vN(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends Z6{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=wf;if(l){for(let u of i)l.tempSkipped.push(u);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=s,new Tt(tr.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return wf}}function vN(e,t,n){return Ra.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class pc{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new pc(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=iv.create(t.facet(js).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new pc(r)}}ci.state=kn.define({create:pc.init,update(e,t){for(let n of t.effects)if(n.is(ci.setState))return n.value;return t.startState.facet(js)!=t.state.facet(js)?pc.init(t.state):e.apply(t)}});let n9=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(n9=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const u1=typeof navigator<"u"&&(!((l1=navigator.scheduling)===null||l1===void 0)&&l1.isInputPending)?()=>navigator.scheduling.isInputPending():null,mje=Ot.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(ci.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(ci.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=n9(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field(ci.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!u1?Math.max(25,t.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>u1&&u1()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:ci.setState.of(new pc(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Kn(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),js=se.define({combine(e){return e.length?e[0]:null},enables:e=>[ci.state,mje,ie.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class gje{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const yje=se.define(),eb=se.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function ov(e){let t=e.facet(eb);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Id(e,t){let n="",r=e.tabSize,i=e.facet(eb)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let o=0;o<t;o++)n+=i;return n}function DP(e,t){e instanceof _e&&(e=new tb(e));for(let r of e.state.facet(yje)){let i=r(e,t);if(i!==void 0)return i}let n=xn(e.state);return n.length>=t?vje(e,n,t):null}class tb{constructor(t,n={}){this.state=t,this.options=n,this.unit=ov(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==t?{text:"",from:t}:(n<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,n=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,n);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.countColumn(r,t-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(t,n=t.length){return Bc(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const r9=new Ae;function vje(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s&&!(s.from<r.node.from||s.to>r.node.to||s.from==r.node.from&&s.type==r.node.type);s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return i9(r,e,n)}function i9(e,t,n){for(let r=e;r;r=r.next){let i=xje(r.node);if(i)return i(LP.create(t,n,r))}return 0}function bje(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function xje(e){let t=e.type.prop(r9);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Ae.closedBy))){let i=e.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>o9(s,!0,1,void 0,o&&!bje(s)?i.from:void 0)}return e.parent==null?wje:null}function wje(){return 0}class LP extends tb{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new LP(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Sje(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return i9(this.context.next,this.base,this.pos)}}function Sje(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function kje(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=t.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let u=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+u}}a=l.to}}function bN({closing:e,align:t=!0,units:n=1}){return r=>o9(r,t,n,e)}function o9(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?kje(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}const Oje=200;function Cje(){return _e.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+Oje)return e;let o=n.sliceString(i.from,r);if(!t.some(u=>u.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:u}of s.selection.ranges){let c=s.doc.lineAt(u);if(c.from==a)continue;a=c.from;let f=DP(s,c.from);if(f==null)continue;let h=/^\s*/.exec(c.text)[0],d=Id(s,f);h!=d&&l.push({from:c.from,to:c.from+h.length,insert:d})}return l.length?[e,{changes:l,sequential:!0}]:e})}const Aje=se.define(),s9=new Ae;function Pje(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Eje(e,t,n){let r=xn(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<t)break;let l=a.type.prop(s9);if(l&&(a.to<r.length-50||r.length==e.doc.length||!Tje(a))){let u=l(a,e);u&&u.from<=n&&u.from>=t&&u.to>n&&(o=u)}}return o}function Tje(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function sv(e,t,n){for(let r of e.facet(Aje)){let i=r(e,t,n);if(i)return i}return Eje(e,t,n)}function a9(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const nb=ke.define({map:a9}),ap=ke.define({map:a9});function l9(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const Ja=kn.define({create(){return he.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((n,r)=>e=xN(e,n,r)),e=e.map(t.changes);for(let n of t.effects)if(n.is(nb)&&!_je(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(f9),i=r?he.replace({widget:new Lje(r(t.state,n.value))}):wN;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(ap)&&(e=e.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=xN(e,t.selection.main.head)),e},provide:e=>ie.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(wN.range(r,i))}return he.set(t,!0)}});function xN(e,t,n=t){let r=!1;return e.between(t,n,(i,o)=>{i<n&&o>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(i,o)=>i>=n||o<=t}):e}function av(e,t,n){var r;let i=null;return(r=e.field(Ja,!1))===null||r===void 0||r.between(t,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function _je(e,t,n){let r=!1;return e.between(t,t,(i,o)=>{i==t&&o==n&&(r=!0)}),r}function u9(e,t){return e.field(Ja,!1)?t:t.concat(ke.appendConfig.of(h9()))}const Mje=e=>{for(let t of l9(e)){let n=sv(e.state,t.from,t.to);if(n)return e.dispatch({effects:u9(e.state,[nb.of(n),c9(e,n)])}),!0}return!1},Ije=e=>{if(!e.state.field(Ja,!1))return!1;let t=[];for(let n of l9(e)){let r=av(e.state,n.from,n.to);r&&t.push(ap.of(r),c9(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function c9(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return ie.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const jje=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=sv(t,i.from,i.to);o&&n.push(nb.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:u9(e.state,n)}),!!n.length},Rje=e=>{let t=e.state.field(Ja,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(ap.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},Nje=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Mje},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ije},{key:"Ctrl-Alt-[",run:jje},{key:"Ctrl-Alt-]",run:Rje}],Dje={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},f9=se.define({combine(e){return Zi(e,Dje)}});function h9(e){return[Ja,Fje]}function d9(e,t){let{state:n}=e,r=n.facet(f9),i=s=>{let a=e.lineBlockAt(e.posAtDOM(s.target)),l=av(e.state,a.from,a.to);l&&e.dispatch({effects:ap.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const wN=he.replace({widget:new class extends Ji{toDOM(e){return d9(e,null)}}});class Lje extends Ji{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return d9(t,this.value)}}const $je={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class c1 extends Io{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function Bje(e={}){let t={...$je,...e},n=new c1(t,!0),r=new c1(t,!1),i=Ot.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(js)!=s.state.facet(js)||s.startState.field(Ja,!1)!=s.state.field(Ja,!1)||xn(s.startState)!=xn(s.state)||t.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new _o;for(let l of s.viewportLineBlocks){let u=av(s.state,l.from,l.to)?r:sv(s.state,l.from,l.to)?n:null;u&&a.add(l.from,l.from,u)}return a.finish()}}),{domEventHandlers:o}=t;return[i,FIe({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Pe.empty},initialSpacer(){return new c1(t,!1)},domEventHandlers:{...o,click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let u=av(s.state,a.from,a.to);if(u)return s.dispatch({effects:ap.of(u)}),!0;let c=sv(s.state,a.from,a.to);return c?(s.dispatch({effects:nb.of(c)}),!0):!1}}}),h9()]}const Fje=ie.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class lp{constructor(t,n){this.specs=t;let r;function i(a){let l=Ts.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof ci?a=>a.prop(nu)==s.data:s?a=>a==s:void 0,this.style=t9(t.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Ts(r):null,this.themeType=n.themeType}static define(t,n){return new lp(t,n||{})}}const hO=se.define(),p9=se.define({combine(e){return e.length?[e[0]]:null}});function f1(e){let t=e.facet(hO);return t.length?t:e.facet(p9)}function m9(e,t){let n=[Wje],r;return e instanceof lp&&(e.module&&n.push(ie.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(p9.of(e)):r?n.push(hO.computeN([ie.darkTheme],i=>i.facet(ie.darkTheme)==(r=="dark")?[e]:[])):n.push(hO.of(e)),n}class zje{constructor(t){this.markCache=Object.create(null),this.tree=xn(t.state),this.decorations=this.buildDeco(t,f1(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=xn(t.state),r=f1(t.state),i=r!=f1(t.startState),{viewport:o}=t.view,s=t.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=o.to)}buildDeco(t,n){if(!n||!this.tree.length)return he.none;let r=new _o;for(let{from:i,to:o}of t.visibleRanges)uje(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=he.mark({class:l})))},i,o);return r.finish()}}const Wje=hl.high(Ot.fromClass(zje,{decorations:e=>e.decorations})),Uje=lp.define([{tag:W.meta,color:"#404740"},{tag:W.link,textDecoration:"underline"},{tag:W.heading,textDecoration:"underline",fontWeight:"bold"},{tag:W.emphasis,fontStyle:"italic"},{tag:W.strong,fontWeight:"bold"},{tag:W.strikethrough,textDecoration:"line-through"},{tag:W.keyword,color:"#708"},{tag:[W.atom,W.bool,W.url,W.contentSeparator,W.labelName],color:"#219"},{tag:[W.literal,W.inserted],color:"#164"},{tag:[W.string,W.deleted],color:"#a11"},{tag:[W.regexp,W.escape,W.special(W.string)],color:"#e40"},{tag:W.definition(W.variableName),color:"#00f"},{tag:W.local(W.variableName),color:"#30a"},{tag:[W.typeName,W.namespace],color:"#085"},{tag:W.className,color:"#167"},{tag:[W.special(W.variableName),W.macroName],color:"#256"},{tag:W.definition(W.propertyName),color:"#00c"},{tag:W.comment,color:"#940"},{tag:W.invalid,color:"#f00"}]),Hje=ie.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),g9=1e4,y9="()[]{}",v9=se.define({combine(e){return Zi(e,{afterCursor:!0,brackets:y9,maxScanDistance:g9,renderMatch:Kje})}}),Vje=he.mark({class:"cm-matchingBracket"}),qje=he.mark({class:"cm-nonmatchingBracket"});function Kje(e){let t=[],n=e.matched?Vje:qje;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function SN(e){let t=[],n=e.facet(v9);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Di(e,r.head,-1,n)||r.head>0&&Di(e,r.head-1,1,n)||n.afterCursor&&(Di(e,r.head,1,n)||r.head<e.doc.length&&Di(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return he.set(t,!0)}const Gje=Ot.fromClass(class{constructor(e){this.paused=!1,this.decorations=SN(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=SN(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),Qje=[Gje,Hje];function Xje(e={}){return[v9.of(e),Qje]}const Yje=new Ae;function dO(e,t,n){let r=e.prop(t<0?Ae.openedBy:Ae.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function pO(e){let t=e.type.prop(Yje);return t?t(e.node):e}function Di(e,t,n,r={}){let i=r.maxScanDistance||g9,o=r.brackets||y9,s=xn(e),a=s.resolveInner(t,n);for(let l=a;l;l=l.parent){let u=dO(l.type,n,o);if(u&&l.from<l.to){let c=pO(l);if(c&&(n>0?t>=c.from&&t<c.to:t>c.from&&t<=c.to))return Zje(e,t,n,l,c,u,o)}}return Jje(e,t,n,s,a.type,i,o)}function Zje(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},u=0,c=a?.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(u==0&&o.indexOf(c.type.name)>-1&&c.from<c.to){let f=pO(c);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(dO(c.type,n,s))u++;else if(dO(c.type,-n,s)){if(u==0){let f=pO(c);return{start:l,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}function Jje(e,t,n,r,i,o,s){if(n<0?!t:t==e.doc.length)return null;let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let h=0;!c.next().done&&h<=o;){let d=c.value;n<0&&(h+=d.length);let p=t+h*n;for(let m=n>0?0:d.length-1,y=n>0?d.length:-1;m!=y;m+=n){let g=s.indexOf(d[m]);if(!(g<0||r.resolveInner(p+m,1).type!=i))if(g%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:p+m,to:p+m+1},matched:g>>1==l>>1};f--}}n>0&&(h+=d.length)}return c.done?{start:u,matched:!1}:null}const eRe=Object.create(null),kN=[tr.none],ON=[],CN=Object.create(null),tRe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])tRe[e]=nRe(eRe,t);function h1(e,t){ON.indexOf(e)>-1||(ON.push(e),console.warn(t))}function nRe(e,t){let n=[];for(let a of t.split(" ")){let l=[];for(let u of a.split(".")){let c=e[u]||W[u];c?typeof c=="function"?l.length?l=l.map(c):h1(u,`Modifier ${u} used at start of tag`):l.length?h1(u,`Tag ${u} used as modifier`):l=Array.isArray(c)?c:[c]:h1(u,`Unknown highlighting tag ${u}`)}for(let u of l)n.push(u)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=CN[i];if(o)return o.id;let s=CN[i]=tr.define({id:kN.length,name:r,props:[J6({[r]:n})]});return kN.push(s),s.id}Ye.RTL,Ye.LTR;const rRe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=BP(e.state,n.from);return r.line?iRe(e):r.block?sRe(e):!1};function $P(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const iRe=$P(uRe,0),oRe=$P(b9,0),sRe=$P((e,t)=>b9(e,t,lRe(t)),0);function BP(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const Sf=50;function aRe(e,{open:t,close:n},r,i){let o=e.sliceDoc(r-Sf,r),s=e.sliceDoc(i,i+Sf),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,u=o.length-a;if(o.slice(u-t.length,u)==t&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let c,f;i-r<=2*Sf?c=f=e.sliceDoc(r,i):(c=e.sliceDoc(r,r+Sf),f=e.sliceDoc(i-Sf,i));let h=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-n.length;return c.slice(h,h+t.length)==t&&f.slice(p,p+n.length)==n?{open:{pos:r+h+t.length,margin:/\s/.test(c.charAt(h+t.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function lRe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function b9(e,t,n=t.selection.ranges){let r=n.map(o=>BP(t,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>aRe(t,r[s],o.from,o.to));if(e!=2&&!i.every(o=>o))return{changes:t.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&i.some(o=>o)){let o=[];for(let s=0,a;s<i.length;s++)if(a=i[s]){let l=r[s],{open:u,close:c}=a;o.push({from:u.pos-l.open.length,to:u.pos+u.margin},{from:c.pos-c.margin,to:c.pos+l.close.length})}return{changes:o}}return null}function uRe(e,t,n=t.selection.ranges){let r=[],i=-1;e:for(let{from:o,to:s}of n){let a=r.length,l=1e9,u;for(let c=o;c<=s;){let f=t.doc.lineAt(c);if(u==null&&(u=BP(t,f.from).line,!u))continue e;if(f.from>i&&(o==s||s>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,p=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<l&&(l=h),r.push({line:f,comment:p,token:u,indent:h,empty:d,single:!1})}c=f.to+1}if(l<1e9)for(let c=a;c<r.length;c++)r[c].indent<r[c].line.text.length&&(r[c].indent=l);r.length==a+1&&(r[a].single=!0)}if(e!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:u,empty:c,single:f}of r)(f||!c)&&o.push({from:a.from+u,insert:l+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let u=s.from+a,c=u+l.length;s.text[c-s.from]==" "&&c++,o.push({from:u,to:c})}return{changes:o}}return null}const mO=Yi.define(),cRe=Yi.define(),fRe=se.define(),x9=se.define({combine(e){return Zi(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),w9=kn.define({create(){return Li.empty},update(e,t){let n=t.state.facet(x9),r=t.annotation(mO);if(r){let l=Gn.fromTransaction(t,r.selection),u=r.side,c=u==0?e.undone:e.done;return l?c=lv(c,c.length,n.minDepth,l):c=O9(c,t.startState.selection),new Li(u==0?r.rest:c,u==0?c:r.rest)}let i=t.annotation(cRe);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Vt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=Gn.fromTransaction(t),s=t.annotation(Vt.time),a=t.annotation(Vt.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Li(e.done.map(Gn.fromJSON),e.undone.map(Gn.fromJSON))}});function hRe(e={}){return[w9,x9.of(e),ie.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?S9:t.inputType=="historyRedo"?gO:null;return r?(t.preventDefault(),r(n)):!1}})]}function rb(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(w9,!1);if(!i)return!1;let o=i.pop(e,n,t);return o?(r(o),!0):!1}}const S9=rb(0,!1),gO=rb(1,!1),dRe=rb(0,!0),pRe=rb(1,!0);class Gn{constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new Gn(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new Gn(t.changes&&Bt.fromJSON(t.changes),[],t.mapped&&Vi.fromJSON(t.mapped),t.startSelection&&V.fromJSON(t.startSelection),t.selectionsAfter.map(V.fromJSON))}static fromTransaction(t,n){let r=zr;for(let i of t.startState.facet(fRe)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new Gn(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,zr)}static selection(t){return new Gn(void 0,zr,void 0,void 0,t)}}function lv(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function mRe(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,s,a)=>{for(let l=0;l<n.length;){let u=n[l++],c=n[l++];a>=u&&s<=c&&(r=!0)}}),r}function gRe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function k9(e,t){return e.length?t.length?e.concat(t):e:t}const zr=[],yRe=200;function O9(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-yRe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),lv(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Gn.selection([t])]}function vRe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function d1(e,t){if(!e.length)return e;let n=e.length,r=zr;for(;n;){let i=bRe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Gn.selection(r)]:zr}function bRe(e,t,n){let r=k9(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):zr,n);if(!e.changes)return Gn.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new Gn(i,ke.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const xRe=/^(input\.type|delete)($|\.)/;class Li{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Li(this.done,this.undone):this}addChanges(t,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||xRe.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,mRe(a.changes,t.changes))||r=="input.type.compose")?s=lv(s,s.length-1,i.minDepth,new Gn(t.changes.compose(a.changes),k9(ke.mapEffects(t.effects,a.changes),a.effects),a.mapped,a.startSelection,zr)):s=lv(s,s.length,i.minDepth,t),new Li(s,zr,n,r)}addSelection(t,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:zr;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&gRe(o[o.length-1],t)?this:new Li(O9(this.done,t),this.undone,n,r)}addMapping(t){return new Li(d1(this.done,t),d1(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],s=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:mO.of({side:t,rest:vRe(i),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?zr:i.slice(0,i.length-1);return o.mapped&&(a=d1(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:mO.of({side:t,rest:a,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Li.empty=new Li(zr,zr);const wRe=[{key:"Mod-z",run:S9,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:gO,preventDefault:!0},{linux:"Ctrl-Shift-z",run:gO,preventDefault:!0},{key:"Mod-u",run:dRe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:pRe,preventDefault:!0}];function Fc(e,t){return V.create(e.ranges.map(t),e.mainIndex)}function vi(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function bi({state:e,dispatch:t},n){let r=Fc(e.selection,n);return r.eq(e.selection,!0)?!1:(t(vi(e,r)),!0)}function ib(e,t){return V.cursor(t?e.to:e.from)}function C9(e,t){return bi(e,n=>n.empty?e.moveByChar(n,t):ib(n,t))}function On(e){return e.textDirectionAt(e.state.selection.main.head)==Ye.LTR}const A9=e=>C9(e,!On(e)),P9=e=>C9(e,On(e));function E9(e,t){return bi(e,n=>n.empty?e.moveByGroup(n,t):ib(n,t))}const SRe=e=>E9(e,!On(e)),kRe=e=>E9(e,On(e));function ORe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ob(e,t,n){let r=xn(e).resolveInner(t.head),i=n?Ae.closedBy:Ae.openedBy;for(let l=t.head;;){let u=n?r.childAfter(l):r.childBefore(l);if(!u)break;ORe(e,u,i)?r=u:l=n?u.to:u.from}let o=r.type.prop(i),s,a;return o&&(s=n?Di(e,r.from,1):Di(e,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,V.cursor(a,n?-1:1)}const CRe=e=>bi(e,t=>ob(e.state,t,!On(e))),ARe=e=>bi(e,t=>ob(e.state,t,On(e)));function T9(e,t){return bi(e,n=>{if(!n.empty)return ib(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const _9=e=>T9(e,!1),M9=e=>T9(e,!0);function I9(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let o of e.state.facet(ie.scrollMargins)){let s=o(e);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function j9(e,t){let n=I9(e),{state:r}=e,i=Fc(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):ib(s,t));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,u=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<u&&(o=ie.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-l}))}return e.dispatch(vi(r,i),{effects:o}),!0}const AN=e=>j9(e,!1),yO=e=>j9(e,!0);function Vs(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(i=V.cursor(r.from+o))}return i}const PRe=e=>bi(e,t=>Vs(e,t,!0)),ERe=e=>bi(e,t=>Vs(e,t,!1)),TRe=e=>bi(e,t=>Vs(e,t,!On(e))),_Re=e=>bi(e,t=>Vs(e,t,On(e))),MRe=e=>bi(e,t=>V.cursor(e.lineBlockAt(t.head).from,1)),IRe=e=>bi(e,t=>V.cursor(e.lineBlockAt(t.head).to,-1));function jRe(e,t,n){let r=!1,i=Fc(e.selection,o=>{let s=Di(e,o.head,-1)||Di(e,o.head,1)||o.head>0&&Di(e,o.head-1,1)||o.head<e.doc.length&&Di(e,o.head+1,-1);if(!s||!s.end)return o;r=!0;let a=s.start.from==o.head?s.end.to:s.end.from;return V.cursor(a)});return r?(t(vi(e,i)),!0):!1}const RRe=({state:e,dispatch:t})=>jRe(e,t);function Xr(e,t){let n=Fc(e.state.selection,r=>{let i=t(r);return V.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(vi(e.state,n)),!0)}function R9(e,t){return Xr(e,n=>e.moveByChar(n,t))}const N9=e=>R9(e,!On(e)),D9=e=>R9(e,On(e));function L9(e,t){return Xr(e,n=>e.moveByGroup(n,t))}const NRe=e=>L9(e,!On(e)),DRe=e=>L9(e,On(e)),LRe=e=>Xr(e,t=>ob(e.state,t,!On(e))),$Re=e=>Xr(e,t=>ob(e.state,t,On(e)));function $9(e,t){return Xr(e,n=>e.moveVertically(n,t))}const B9=e=>$9(e,!1),F9=e=>$9(e,!0);function z9(e,t){return Xr(e,n=>e.moveVertically(n,t,I9(e).height))}const PN=e=>z9(e,!1),EN=e=>z9(e,!0),BRe=e=>Xr(e,t=>Vs(e,t,!0)),FRe=e=>Xr(e,t=>Vs(e,t,!1)),zRe=e=>Xr(e,t=>Vs(e,t,!On(e))),WRe=e=>Xr(e,t=>Vs(e,t,On(e))),URe=e=>Xr(e,t=>V.cursor(e.lineBlockAt(t.head).from)),HRe=e=>Xr(e,t=>V.cursor(e.lineBlockAt(t.head).to)),TN=({state:e,dispatch:t})=>(t(vi(e,{anchor:0})),!0),_N=({state:e,dispatch:t})=>(t(vi(e,{anchor:e.doc.length})),!0),MN=({state:e,dispatch:t})=>(t(vi(e,{anchor:e.selection.main.anchor,head:0})),!0),IN=({state:e,dispatch:t})=>(t(vi(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),VRe=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),qRe=({state:e,dispatch:t})=>{let n=sb(e).map(({from:r,to:i})=>V.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:V.create(n),userEvent:"select"})),!0},KRe=({state:e,dispatch:t})=>{let n=Fc(e.selection,r=>{let i=xn(e),o=i.resolveStack(r.from,1);if(r.empty){let s=i.resolveStack(r.from,-1);s.node.from>=o.node.from&&s.node.to<=o.node.to&&(o=s)}for(let s=o;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&s.next)return V.range(a.to,a.from)}return r});return n.eq(e.selection)?!1:(t(vi(e,n)),!0)};function W9(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let o of n.selection.ranges){let s=n.doc.lineAt(o.head);if(t?s.to<e.state.doc.length:s.from>0)for(let a=o;;){let l=e.moveVertically(a,t);if(l.head<s.from||l.head>s.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(e.dispatch(vi(n,V.create(i,i.length-1))),!0)}const GRe=e=>W9(e,!1),QRe=e=>W9(e,!0),XRe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=V.create([n.main]):n.main.empty||(r=V.create([V.cursor(n.main.head)])),r?(t(vi(e,r)),!0):!1};function up(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=t(o);l<s?(n="delete.backward",l=vm(e,l,!1)):l>s&&(n="delete.forward",l=vm(e,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=vm(e,s,!1),a=vm(e,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:V.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ie.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function vm(e,t,n){if(e instanceof ie)for(let r of e.state.facet(ie.atomicRanges).map(i=>i(e)))r.between(t,t,(i,o)=>{i<t&&o>t&&(t=n?o:i)});return t}const U9=(e,t,n)=>up(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,i-s.from))){if(a[a.length-1]==" ")return i-1;let u=Bc(a,o.tabSize),c=u%ov(o)||ov(o);for(let f=0;f<c&&a[a.length-1-f]==" ";f++)i--;l=i}else l=Yt(s.text,i-s.from,t,t)+s.from,l==i&&s.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,i-s.from))&&(l=Yt(s.text,l-s.from,!1,!1)+s.from);return l}),vO=e=>U9(e,!1,!0),H9=e=>U9(e,!0,!1),V9=(e,t)=>up(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=Yt(o.text,r-o.from,t)+o.from,u=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),c=s(u);if(a!=null&&c!=a)break;(u!=" "||r!=n.head)&&(a=c),r=l}return r}),q9=e=>V9(e,!1),YRe=e=>V9(e,!0),ZRe=e=>up(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),JRe=e=>up(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),eNe=e=>up(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),tNe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Me.of(["",""])},range:V.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},nNe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,o=e.doc.lineAt(i),s=i==o.from?i-1:Yt(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:Yt(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:e.doc.slice(i,a).append(e.doc.slice(s,i))},range:V.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sb(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=i.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function K9(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let o of sb(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let l of o.ranges)i.push(V.range(Math.min(e.doc.length,l.anchor+a),Math.min(e.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let l of o.ranges)i.push(V.range(l.anchor-a,l.head-a))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:V.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const rNe=({state:e,dispatch:t})=>K9(e,t,!1),iNe=({state:e,dispatch:t})=>K9(e,t,!0);function G9(e,t,n){if(e.readOnly)return!1;let r=[];for(let o of sb(e))n?r.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):r.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const oNe=({state:e,dispatch:t})=>G9(e,t,!1),sNe=({state:e,dispatch:t})=>G9(e,t,!0),aNe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(sb(t).map(({from:i,to:o})=>(i>0?i--:o<t.doc.length&&o++,{from:i,to:o}))),r=Fc(t.selection,i=>{let o;if(e.lineWrapping){let s=e.lineBlockAt(i.head),a=e.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function lNe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=xn(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Ae.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const jN=Q9(!1),uNe=Q9(!0);function Q9(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:o,to:s}=i,a=t.doc.lineAt(o),l=!e&&o==s&&lNe(t,o);e&&(o=s=(s<=a.to?a:t.doc.lineAt(s)).to);let u=new tb(t,{simulateBreak:o,simulateDoubleBreak:!!l}),c=DP(u,o);for(c==null&&(c=Bc(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:o,to:s}=l:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let f=["",Id(t,c)];return l&&f.push(Id(t,u.lineIndent(a.from,-1))),{changes:{from:o,to:s,insert:Me.of(f)},range:V.cursor(o+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function FP(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let a=e.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),s=a.to+1}let o=e.changes(i);return{changes:i,range:V.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const cNe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new tb(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=FP(e,(o,s,a)=>{let l=DP(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let u=/^\s*/.exec(o.text)[0],c=Id(e,l);(u!=c||a.from<o.from+u.length)&&(n[o.from]=l,s.push({from:o.from,to:o.from+u.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},X9=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(FP(e,(n,r)=>{r.push({from:n.from,insert:e.facet(eb)})}),{userEvent:"input.indent"})),!0),Y9=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(FP(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Bc(i,e.tabSize),s=0,a=Id(e,Math.max(0,o-ov(e)));for(;s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),fNe=e=>(e.setTabFocusMode(),!0),hNe=[{key:"Ctrl-b",run:A9,shift:N9,preventDefault:!0},{key:"Ctrl-f",run:P9,shift:D9},{key:"Ctrl-p",run:_9,shift:B9},{key:"Ctrl-n",run:M9,shift:F9},{key:"Ctrl-a",run:MRe,shift:URe},{key:"Ctrl-e",run:IRe,shift:HRe},{key:"Ctrl-d",run:H9},{key:"Ctrl-h",run:vO},{key:"Ctrl-k",run:ZRe},{key:"Ctrl-Alt-h",run:q9},{key:"Ctrl-o",run:tNe},{key:"Ctrl-t",run:nNe},{key:"Ctrl-v",run:yO}],dNe=[{key:"ArrowLeft",run:A9,shift:N9,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:SRe,shift:NRe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:TRe,shift:zRe,preventDefault:!0},{key:"ArrowRight",run:P9,shift:D9,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:kRe,shift:DRe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_Re,shift:WRe,preventDefault:!0},{key:"ArrowUp",run:_9,shift:B9,preventDefault:!0},{mac:"Cmd-ArrowUp",run:TN,shift:MN},{mac:"Ctrl-ArrowUp",run:AN,shift:PN},{key:"ArrowDown",run:M9,shift:F9,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_N,shift:IN},{mac:"Ctrl-ArrowDown",run:yO,shift:EN},{key:"PageUp",run:AN,shift:PN},{key:"PageDown",run:yO,shift:EN},{key:"Home",run:ERe,shift:FRe,preventDefault:!0},{key:"Mod-Home",run:TN,shift:MN},{key:"End",run:PRe,shift:BRe,preventDefault:!0},{key:"Mod-End",run:_N,shift:IN},{key:"Enter",run:jN,shift:jN},{key:"Mod-a",run:VRe},{key:"Backspace",run:vO,shift:vO,preventDefault:!0},{key:"Delete",run:H9,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:q9,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:YRe,preventDefault:!0},{mac:"Mod-Backspace",run:JRe,preventDefault:!0},{mac:"Mod-Delete",run:eNe,preventDefault:!0}].concat(hNe.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),pNe=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:CRe,shift:LRe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:ARe,shift:$Re},{key:"Alt-ArrowUp",run:rNe},{key:"Shift-Alt-ArrowUp",run:oNe},{key:"Alt-ArrowDown",run:iNe},{key:"Shift-Alt-ArrowDown",run:sNe},{key:"Mod-Alt-ArrowUp",run:GRe},{key:"Mod-Alt-ArrowDown",run:QRe},{key:"Escape",run:XRe},{key:"Mod-Enter",run:uNe},{key:"Alt-l",mac:"Ctrl-l",run:qRe},{key:"Mod-i",run:KRe,preventDefault:!0},{key:"Mod-[",run:Y9},{key:"Mod-]",run:X9},{key:"Mod-Alt-\\",run:cNe},{key:"Shift-Mod-k",run:aNe},{key:"Shift-Mod-\\",run:RRe},{key:"Mod-/",run:rRe},{key:"Alt-A",run:oRe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:fNe}].concat(dNe),mNe={key:"Tab",run:X9,shift:Y9},RN=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class mc{constructor(t,n,r=0,i=t.length,o,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(RN(a)):RN,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Fn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=dP(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ii(t);let i=this.normalize(n);if(i.length)for(let o=0,s=r,a=!0;;o++){let l=i.charCodeAt(o),u=this.match(l,s,a,this.bufferPos+this.bufferStart,o==i.length-1);if(u)return this.value=u,this;if(o==i.length-1)break;a&&o<n.length&&n.charCodeAt(o)==l?s++:a=!1}}}match(t,n,r,i,o){let s=null;for(let a=0;a<this.matches.length;){let l=this.matches[a],u=!1;this.query.charCodeAt(l.index)==t&&(l.index==this.query.length-1?s={from:l.from,to:i,precise:o&&l.precise}:(l.index++,u=!0)),u?a++:this.matches.splice(a,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:n,to:i,precise:r&&o}:this.matches.push({from:n,index:1,precise:r})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(mc.prototype[Symbol.iterator]=function(){return this});const Z9={from:-1,to:-1,match:/.*/.exec(""),precise:!0},zP="gm"+(/x/.unicode==null?"":"u");class J9{constructor(t,n,r,i=0,o=t.length){if(this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=Z9,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new eW(t,n,r,i,o);this.re=new RegExp(n,zP+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let s=t.lineAt(i);this.curLineStart=s.from,this.matchPos=uv(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=uv(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const p1=new WeakMap;class Su{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=p1.get(t);if(!i||i.from>=r||i.to<=n){let a=new Su(n,t.sliceString(n,r));return p1.set(t,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=t.sliceString(n,s)+o,s=n),i.to<r&&(o+=t.sliceString(i.to,r)),p1.set(t,new Su(s,o)),new Su(n,o.slice(n-s,r-s))}}class eW{constructor(t,n,r,i,o){this.text=t,this.to=o,this.done=!1,this.value=Z9,this.matchPos=uv(t,i),this.re=new RegExp(n,zP+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Su.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=uv(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Su.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(J9.prototype[Symbol.iterator]=eW.prototype[Symbol.iterator]=function(){return this});function gNe(e){try{return new RegExp(e,zP),!0}catch{return!1}}function uv(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const yNe=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=DIe(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(o=>{let s=o&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.elements.line.value);if(!s){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,l,u,c,f]=s,h=c?+c.slice(1):0,d=u?+u:a.number;if(u&&f){let y=d/100;l&&(y=y*(l=="-"?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*y)}else u&&l&&(d=d*(l=="-"?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),m=V.cursor(p.from+Math.max(0,Math.min(h,p.length)));e.dispatch({effects:[r,ie.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},vNe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},bNe=se.define({combine(e){return Zi(e,vNe,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function xNe(e){return[CNe,ONe]}const wNe=he.mark({class:"cm-selectionMatch"}),SNe=he.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function NN(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=gt.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=gt.Word)}function kNe(e,t,n,r){return e(t.sliceDoc(n,n+1))==gt.Word&&e(t.sliceDoc(r-1,r))==gt.Word}const ONe=Ot.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(bNe),{state:n}=e,r=n.selection;if(r.ranges.length>1)return he.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return he.none;let l=n.wordAt(i.head);if(!l)return he.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<t.minSelectionLength||l>200)return he.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(NN(s,n,i.from,i.to)&&kNe(s,n,i.from,i.to)))return he.none}else if(o=n.sliceDoc(i.from,i.to),!o)return he.none}let a=[];for(let l of e.visibleRanges){let u=new mc(n.doc,o,l.from,l.to);for(;!u.next().done;){let{from:c,to:f}=u.value;if((!s||NN(s,n,c,f))&&(i.empty&&c<=i.from&&f>=i.to?a.push(SNe.range(c,f)):(c>=i.to||f<=i.from)&&a.push(wNe.range(c,f)),a.length>t.maxMatches))return he.none}}return he.set(a)}},{decorations:e=>e.decorations}),CNe=ie.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ANe=({state:e,dispatch:t})=>{let{selection:n}=e,r=V.create(n.ranges.map(i=>e.wordAt(i.head)||V.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function PNe(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new mc(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new mc(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=e.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const ENe=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(o=>o.from===o.to))return ANe({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(o=>e.sliceDoc(o.from,o.to)!=r))return!1;let i=PNe(e,r);return i?(t(e.update({selection:e.selection.addRange(V.range(i.from,i.to),!1),effects:ie.scrollIntoView(i.to)})),!0):!1},zc=se.define({combine(e){return Zi(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new WNe(t),scrollToMatch:t=>ie.scrollIntoView(t)})}});class tW{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||gNe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
414
+ `:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new RNe(this):new MNe(this)}getCursor(t,n=0,r){let i=t.doc?t:_e.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?jl(this,i,n,r):Il(this,i,n,r)}}class nW{constructor(t){this.spec=t}}function TNe(e,t,n){return(r,i,o,s)=>{if(n&&!n(r,i,o,s))return!1;let a=r>=s&&i<=s+o.length?o.slice(r-s,i-s):t.doc.sliceString(r,i);return e(a,t,r,i)}}function Il(e,t,n,r){let i;return e.wholeWord&&(i=_Ne(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=TNe(e.test,t,i)),new mc(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:o=>o.toLowerCase(),i)}function _Ne(e,t){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=e.sliceString(o,Math.min(e.length,r+2))),(t(cv(i,n-o))!=gt.Word||t(fv(i,n-o))!=gt.Word)&&(t(fv(i,r-o))!=gt.Word||t(cv(i,r-o))!=gt.Word))}class MNe extends nW{constructor(t){super(t)}nextMatch(t,n,r){let i=Il(this.spec,t,r,t.doc.length).nextOverlapping();if(i.done){let o=Math.min(t.doc.length,n+this.spec.unquoted.length);i=Il(this.spec,t,0,o).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(t,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=Il(this.spec,t,o,i),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(o==n)return null;i-=1e4}}prevMatch(t,n,r){let i=this.prevMatchInRange(t,0,n);return i||(i=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=Il(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=Il(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function INe(e,t,n){return(r,i,o)=>(!n||n(r,i,o))&&e(o[0],t,r,i)}function jl(e,t,n,r){let i;return e.wholeWord&&(i=jNe(t.charCategorizer(t.selection.main.head))),e.test&&(i=INe(e.test,t,i)),new J9(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function cv(e,t){return e.slice(Yt(e,t,!1),t)}function fv(e,t){return e.slice(t,Yt(e,t))}function jNe(e){return(t,n,r)=>!r[0].length||(e(cv(r.input,r.index))!=gt.Word||e(fv(r.input,r.index))!=gt.Word)&&(e(fv(r.input,r.index+r[0].length))!=gt.Word||e(cv(r.input,r.index+r[0].length))!=gt.Word)}class RNe extends nW{nextMatch(t,n,r){let i=jl(this.spec,t,r,t.doc.length).next();return i.done&&(i=jl(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=jl(this.spec,t,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let o=+r.slice(0,i);if(o>0&&o<t.match.length)return t.match[o]+r.slice(i)}return n})}matchAll(t,n){let r=jl(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=jl(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const jd=ke.define(),WP=ke.define(),Ss=kn.define({create(e){return new m1(bO(e).create(),null)},update(e,t){for(let n of t.effects)n.is(jd)?e=new m1(n.value.create(),e.panel):n.is(WP)&&(e=new m1(e.query,n.value?UP:null));return e},provide:e=>Td.from(e,t=>t.panel)});class m1{constructor(t,n){this.query=t,this.panel=n}}const NNe=he.mark({class:"cm-searchMatch"}),DNe=he.mark({class:"cm-searchMatch cm-searchMatch-selected"}),LNe=Ot.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Ss))}update(e){let t=e.state.field(Ss);(t!=e.startState.field(Ss)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return he.none;let{view:n}=this,r=new _o;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:a,to:l}=o[i];for(;i<s-1&&l>o[i+1].from-2*250;)l=o[++i].to;e.highlight(n.state,a,l,(u,c)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==c);r.add(u,c,f?DNe:NNe)})}return r.finish()}},{decorations:e=>e.decorations});function cp(e){return t=>{let n=t.state.field(Ss,!1);return n&&n.query.spec.valid?e(t,n):oW(t)}}const hv=cp((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=V.single(r.from,r.to),o=e.state.facet(zc);return e.dispatch({selection:i,effects:[HP(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),iW(e),!0}),dv=cp((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=V.single(i.from,i.to),s=e.state.facet(zc);return e.dispatch({selection:o,effects:[HP(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),iW(e),!0}),$Ne=cp((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:V.create(n.map(r=>V.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),BNe=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new mc(e.doc,e.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(V.range(a.value.from,a.value.to))}return t(e.update({selection:V.create(o,s),userEvent:"select.search.matches"})),!0},DN=cp((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,u,c=[];s.precise?s.from==r&&s.to==i&&(u=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:u}),c.push(ie.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):s=t.nextMatch(n,s.from,s.to);let f=e.state.changes(a);return s&&(l=V.single(s.from,s.to).map(f),c.push(HP(e,s)),c.push(n.facet(zc).scrollToMatch(l.main,e))),e.dispatch({changes:f,selection:l,effects:c,userEvent:"input.replace"}),!0}),FNe=cp((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:o,to:s,precise:a}=i;a&&n.push({from:o,to:s,insert:t.getReplacement(i)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:ie.announce.of(r),userEvent:"input.replace.all"}),!0});function UP(e){return e.state.facet(zc).createPanel(e)}function bO(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let u=e.facet(zc);return new tW({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:u.literal,regexp:(o=t?.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(s=t?.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function rW(e){let t=MP(e,UP);return t&&t.dom.querySelector("[main-field]")}function iW(e){let t=rW(e);t&&t==e.root.activeElement&&t.select()}const oW=e=>{let t=e.state.field(Ss,!1);if(t&&t.panel){let n=rW(e);if(n&&n!=e.root.activeElement){let r=bO(e.state,t.query.spec);r.valid&&e.dispatch({effects:jd.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[WP.of(!0),t?jd.of(bO(e.state,t.query.spec)):ke.appendConfig.of(HNe)]});return!0},sW=e=>{let t=e.state.field(Ss,!1);if(!t||!t.panel)return!1;let n=MP(e,UP);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:WP.of(!1)}),!0},zNe=[{key:"Mod-f",run:oW,scope:"editor search-panel"},{key:"F3",run:hv,shift:dv,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:hv,shift:dv,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sW,scope:"editor search-panel"},{key:"Mod-Shift-l",run:BNe},{key:"Mod-Alt-g",run:yNe},{key:"Mod-d",run:ENe,preventDefault:!0}];class WNe{constructor(t){this.view=t;let n=this.query=t.state.field(Ss).query.spec;this.commit=this.commit.bind(this),this.searchField=Ue("input",{value:n.search,placeholder:ar(t,"Find"),"aria-label":ar(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ue("input",{value:n.replace,placeholder:ar(t,"Replace"),"aria-label":ar(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ue("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Ue("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Ue("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Ue("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Ue("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>hv(t),[ar(t,"next")]),r("prev",()=>dv(t),[ar(t,"previous")]),r("select",()=>$Ne(t),[ar(t,"all")]),Ue("label",null,[this.caseField,ar(t,"match case")]),Ue("label",null,[this.reField,ar(t,"regexp")]),Ue("label",null,[this.wordField,ar(t,"by word")]),...t.state.readOnly?[]:[Ue("br"),this.replaceField,r("replace",()=>DN(t),[ar(t,"replace")]),r("replaceAll",()=>FNe(t),[ar(t,"replace all")])],Ue("button",{name:"close",onclick:()=>sW(t),"aria-label":ar(t,"close"),type:"button"},["×"])])}commit(){let t=new tW({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:jd.of(t)}))}keydown(t){qMe(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?dv:hv)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),DN(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(jd)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(zc).top}}function ar(e,t){return e.state.phrase(t)}const bm=30,xm=/[\s\.,:;?!]/;function HP(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-bm),s=Math.min(i,n+bm),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;l<bm;l++)if(!xm.test(a[l+1])&&xm.test(a[l])){a=a.slice(l);break}}if(s!=i){for(let l=a.length-1;l>a.length-bm;l--)if(!xm.test(a[l-1])&&xm.test(a[l])){a=a.slice(0,l);break}}return ie.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}const UNe=ie.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),HNe=[Ss,hl.low(LNe),UNe];class aW{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=xn(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(lW(t,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function LN(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function VNe(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=LN(t)+LN(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function qNe(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:VNe(t);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:t,validFor:n}:null}}class $N{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Na(e){return e.selection.main.from}function lW(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?e:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const uW=Yi.define();function KNe(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:V.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const BN=new WeakMap;function GNe(e){if(!Array.isArray(e))return e;let t=BN.get(e);return t||BN.set(e,t=qNe(e)),t}const pv=ke.define(),Rd=ke.define();class QNe{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<t.length;){let r=Fn(t,n),i=Ii(r);this.chars.push(r);let o=t.slice(n,n+i),s=o.toUpperCase();this.folded.push(Fn(s==o?o.toLowerCase():s,0)),n+=i}this.astral=t.length!=this.chars.length}ret(t,n){return this.score=t,this.matched=n,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let v=Fn(t,0),x=Ii(v),k=x==t.length?0:-100;if(v!=n[0])if(v==r[0])k+=-200;else return null;return this.ret(k,[0,x])}let a=t.indexOf(this.pattern);if(a==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,u=0;if(a<0){for(let v=0,x=Math.min(t.length,200);v<x&&u<l;){let k=Fn(t,v);(k==n[u]||k==r[u])&&(i[u++]=v),v+=Ii(k)}if(u<l)return null}let c=0,f=0,h=!1,d=0,p=-1,m=-1,y=/[a-z]/.test(t),g=!0;for(let v=0,x=Math.min(t.length,200),k=0;v<x&&f<l;){let w=Fn(t,v);a<0&&(c<l&&w==n[c]&&(o[c++]=v),d<l&&(w==n[d]||w==r[d]?(d==0&&(p=v),m=v+1,d++):d=0));let S,O=w<255?w>=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(S=dP(w))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!v||O==1&&y||k==0&&O!=0)&&(n[f]==w||r[f]==w&&(h=!0)?s[f++]=v:s.length&&(g=!1)),k=O,v+=Ii(w)}return f==l&&s[0]==0&&g?this.result(-100+(h?-200:0),s,t):d==l&&p==0?this.ret(-200-t.length+(m==t.length?0:-100),[0,m]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):d==l?this.ret(-900-t.length,[p,m]):f==l?this.result(-100+(h?-200:0)+-700+(g?0:-1100),s,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Ii(Fn(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(t-r.length,i)}}class XNe{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let n=t.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(t.length==this.pattern.length?0:-100),this)}}const Xt=se.define({combine(e){return Zi(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:YNe,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>FN(t(r),n(r)),optionClass:(t,n)=>r=>FN(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function FN(e,t){return e?t?e+" "+t:e:t}function YNe(e,t,n,r,i,o){let s=e.textDirection==Ye.RTL,a=s,l=!1,u="top",c,f,h=t.left-i.left,d=i.right-t.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&h<Math.min(p,d)?a=!1:!a&&d<Math.min(p,h)&&(a=!0),p<=(a?h:d))c=Math.max(i.top,Math.min(n.top,i.bottom-m))-t.top,f=Math.min(400,a?h:d);else{l=!0,f=Math.min(400,(s?t.right:i.right-t.left)-30);let v=i.bottom-t.bottom;v>=m||v>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let y=(t.bottom-t.top)/o.offsetHeight,g=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/y}px; max-width: ${f/g}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}const VP=ke.define();function ZNe(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let u=0;u<o.length;){let c=o[u++],f=o[u++];c>l&&s.appendChild(document.createTextNode(a.slice(l,c)));let h=s.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(a.slice(c,f))),h.className="cm-completionMatchedText",l=f}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}function g1(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class JNe{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:o,selected:s}=i.open,a=t.state.facet(Xt);this.optionContent=ZNe(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=g1(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",l=>{let{options:u}=t.state.field(n).open;for(let c=l.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<u.length){this.applyCompletion(t,u[+f[1]]),l.preventDefault();return}if(l.target==this.list){let c=this.list.classList.contains("cm-completionListIncompleteTop")&&l.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&l.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(t.dispatch({effects:VP.of(c)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Xt).closeOnBlur&&l.relatedTarget!=t.contentDOM&&t.dispatch({effects:Rd.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=g1(o.length,s,t.state.facet(Xt).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=g1(n.options.length,n.selected,this.view.state.facet(Xt).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:o}=i;if(!o)return;let s=typeof o=="string"?document.createTextNode(o):o(i);if(!s)return;"then"in s?s.then(a=>{a&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(a,i)}).catch(a=>Kn(this.view.state,a,"completion info")):(this.addInfoPane(s,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:o}=t;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&tDe(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:s.clientWidth,bottom:s.clientHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(Xt).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",s=>{s.target==i&&s.preventDefault()});let o=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=t[s],{section:u}=a;if(u){let h=typeof u=="string"?u:u.name;if(h!=o&&(s>r.from||r.from==0))if(o=h,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let d=i.appendChild(document.createElement("completion-section"));d.textContent=h}}const c=i.appendChild(document.createElement("li"));c.id=n+"-"+s,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let h of this.optionContent){let d=h(a,this.view.state,this.view,l);d&&c.appendChild(d)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function eDe(e,t){return n=>new JNe(n,e,t)}function tDe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function zN(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function nDe(e,t){let n=[],r=null,i=null,o=c=>{n.push(c);let{section:f}=c.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(d=>d.name==h)||r.push(typeof f=="string"?{name:h}:f)}},s=t.facet(Xt);for(let c of e)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let h of c.result.options)o(new $N(h,c.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(c.from,c.to),d,p=s.filterStrict?new XNe(h):new QNe(h);for(let m of c.result.options)if(d=p.match(m.label)){let y=m.displayLabel?f?f(m,d.matched):[]:d.matched,g=d.score+(m.boost||0);if(o(new $N(m,c.source,y,g)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:v}=m.section;i||(i=Object.create(null)),i[v]=Math.max(g,i[v]||-1e9)}}}}if(r){let c=Object.create(null),f=0,h=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.name<p.name?-1:1);for(let d of r.sort(h))f-=1e5,c[d.name]=f;for(let d of n){let{section:p}=d.completion;p&&(d.score+=c[typeof p=="string"?p:p.name])}}let a=[],l=null,u=s.compareCompletions;for(let c of n.sort((f,h)=>h.score-f.score||u(f.completion,h.completion))){let f=c.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(c):zN(c.completion)>zN(l)&&(a[a.length-1]=c),l=c.completion}return a}class ru{constructor(t,n,r,i,o,s){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new ru(this.options,WN(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,o,s){if(i&&!s&&t.some(u=>u.isPending))return i.setDisabled();let a=nDe(t,n);if(!a.length)return i&&t.some(u=>u.isPending)?i.setDisabled():null;let l=n.facet(Xt).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let u=i.options[i.selected].completion;for(let c=0;c<a.length;c++)if(a[c].completion==u){l=c;break}}return new ru(a,WN(r,l),{pos:t.reduce((u,c)=>c.hasResult()?Math.min(u,c.from):u,1e8),create:lDe,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(t){return new ru(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new ru(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class mv{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new mv(sDe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Xt),o=(r.override||n.languageDataAt("autocomplete",Na(n)).map(GNe)).map(l=>(this.active.find(c=>c.source==l)||new Wr(l,this.active.some(c=>c.state!=0)?1:0)).update(t,r));o.length==this.active.length&&o.every((l,u)=>l==this.active[u])&&(o=this.active);let s=this.open,a=t.effects.some(l=>l.is(qP));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||o.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!rDe(o,this.active)||a?s=ru.build(o,n,this.id,s,r,a):s&&s.disabled&&!o.some(l=>l.isPending)&&(s=null),!s&&o.every(l=>!l.isPending)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Wr(l.source,0):l));for(let l of t.effects)l.is(VP)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new mv(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?iDe:oDe}}function rDe(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}const iDe={"aria-autocomplete":"list"},oDe={};function WN(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const sDe=[];function cW(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(uW);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Wr{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=cW(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Wr(i.source,0)),r&4&&i.state==0&&(i=new Wr(this.source,1)),i=i.updateFor(t,r);for(let o of t.effects)if(o.is(pv))i=new Wr(i.source,1,o.value);else if(o.is(Rd))i=new Wr(i.source,0);else if(o.is(qP))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Na(t.state))}}class ku extends Wr{constructor(t,n,r,i,o,s){super(t,3,n),this.limit=r,this.result=i,this.from=o,this.to=s}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let o=t.changes.mapPos(this.from),s=t.changes.mapPos(this.to,1),a=Na(t.state);if(a>s||!i||n&2&&(Na(t.startState)==this.from||a<this.limit))return new Wr(this.source,n&4?1:0);let l=t.changes.mapPos(this.limit);return aDe(i.validFor,t.state,o,s)?new ku(this.source,this.explicit,l,i,o,s):i.update&&(i=i.update(i,o,s,new aW(t.state,a,!1)))?new ku(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Na(t.state)):new Wr(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new ku(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Wr(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function aDe(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):lW(e,!0).test(i)}const qP=ke.define({map(e,t){return e.map(n=>n.map(t))}}),zn=kn.define({create(){return mv.start()},update(e,t){return e.update(t)},provide:e=>[_P.from(e,t=>t.tooltip),ie.contentAttributes.from(e,t=>t.attrs)]});function KP(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(zn).active.find(i=>i.source==t.source);return r instanceof ku?(typeof n=="string"?e.dispatch({...KNe(e.state,n,r.from,r.to),annotations:uW.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const lDe=eDe(zn,KP);function wm(e,t="option"){return n=>{let r=n.state.field(zn,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Xt).interactionDelay)return!1;let i=1,o;t=="page"&&(o=W6(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a=t=="page"?0:s-1:a>=s&&(a=t=="page"?s-1:0),n.dispatch({effects:VP.of(a)}),!0}}const uDe=e=>{let t=e.state.field(zn,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Xt).interactionDelay?!1:KP(e,t.open.options[t.open.selected])},y1=e=>e.state.field(zn,!1)?(e.dispatch({effects:pv.of(!0)}),!0):!1,cDe=e=>{let t=e.state.field(zn,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:Rd.of(null)}),!0)};class fDe{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const hDe=50,dDe=1e3,pDe=Ot.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(zn).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(zn),n=e.state.facet(Xt);if(!e.selectionSet&&!e.docChanged&&e.startState.field(zn)==t)return;let r=e.transactions.some(o=>{let s=cW(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;o<this.running.length;o++){let s=this.running[o];if(r||s.context.abortOnDocChange&&e.docChanged||s.updates.length+e.transactions.length>hDe&&Date.now()-s.time>dDe){for(let a of s.context.abortListeners)try{a()}catch(l){Kn(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(o=>o.effects.some(s=>s.is(pv)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(o=>o.isPending&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of e.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(zn);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Xt).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Na(t),r=new aW(t,n,e.explicit,this.view),i=new fDe(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:Rd.of(null)}),Kn(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Xt).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Xt),r=this.view.state.field(zn);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(o.done===void 0)continue;if(this.running.splice(i--,1),o.done){let a=Na(o.updates.length?o.updates[0].startState:this.view.state),l=Math.min(a,o.done.from+(o.active.explicit?0:1)),u=new ku(o.active.source,o.active.explicit,l,o.done,o.done.from,(e=o.done.to)!==null&&e!==void 0?e:a);for(let c of o.updates)u=u.update(c,n);if(u.hasResult()){t.push(u);continue}}let s=r.active.find(a=>a.source==o.active.source);if(s&&s.isPending)if(o.done==null){let a=new Wr(o.active.source,0);for(let l of o.updates)a=a.update(l,n);a.isPending||t.push(a)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:qP.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(zn,!1);if(t&&t.tooltip&&this.view.state.facet(Xt).closeOnBlur){let n=t.open&&W6(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Rd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:pv.of(!1)}),20),this.composing=0}}}),mDe=typeof navigator=="object"&&/Win/.test(navigator.platform),gDe=hl.highest(ie.domEventHandlers({keydown(e,t){let n=t.state.field(zn,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(mDe&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&KP(t,r),!1}})),yDe=ie.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Nd={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ka=ke.define({map(e,t){let n=t.mapPos(e,-1,_n.TrackAfter);return n??void 0}}),GP=new class extends Es{};GP.startSide=1;GP.endSide=-1;const fW=kn.define({create(){return Pe.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(ka)&&(e=e.update({add:[GP.range(n.value,n.value+1)]}));return e}});function vDe(){return[xDe,fW]}const v1="()[]{}<>«»»«[]{}";function hW(e){for(let t=0;t<v1.length;t+=2)if(v1.charCodeAt(t)==e)return v1.charAt(t+1);return dP(e<128?e:e+1)}function dW(e,t){return e.languageDataAt("closeBrackets",t)[0]||Nd}const bDe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),xDe=ie.inputHandler.of((e,t,n,r)=>{if((bDe?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Ii(Fn(r,0))==1||t!=i.from||n!=i.to)return!1;let o=kDe(e.state,r);return o?(e.dispatch(o),!0):!1}),wDe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=dW(e,e.selection.main.head).brackets||Nd.brackets,i=null,o=e.changeByRange(s=>{if(s.empty){let a=ODe(e.doc,s.head);for(let l of r)if(l==a&&ab(e.doc,s.head)==hW(Fn(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:V.cursor(s.head-l.length)}}return{range:i=s}});return i||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},SDe=[{key:"Backspace",run:wDe}];function kDe(e,t){let n=dW(e,e.selection.main.head),r=n.brackets||Nd.brackets;for(let i of r){let o=hW(Fn(i,0));if(t==i)return o==i?PDe(e,i,r.indexOf(i+i+i)>-1,n):CDe(e,i,o,n.before||Nd.before);if(t==o&&pW(e,e.selection.main.from))return ADe(e,i,o)}return null}function pW(e,t){let n=!1;return e.field(fW).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function ab(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Ii(Fn(n,0)))}function ODe(e,t){let n=e.sliceString(t-2,t);return Ii(Fn(n,0))==n.length?n:n.slice(1)}function CDe(e,t,n,r){let i=null,o=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:ka.of(s.to+t.length),range:V.range(s.anchor+t.length,s.head+t.length)};let a=ab(e.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:ka.of(s.head+t.length),range:V.cursor(s.head+t.length)}:{range:i=s}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ADe(e,t,n){let r=null,i=e.changeByRange(o=>o.empty&&ab(e.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:V.cursor(o.head+n.length)}:r={range:o});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function PDe(e,t,n,r){let i=r.stringPrefixes||Nd.stringPrefixes,o=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:ka.of(a.to+t.length),range:V.range(a.anchor+t.length,a.head+t.length)};let l=a.head,u=ab(e.doc,l),c;if(u==t){if(UN(e,l))return{changes:{insert:t+t,from:l},effects:ka.of(l+t.length),range:V.cursor(l+t.length)};if(pW(e,l)){let h=n&&e.sliceDoc(l,l+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+h.length,insert:h},range:V.cursor(l+h.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(c=HN(e,l-2*t.length,i))>-1&&UN(e,c))return{changes:{insert:t+t+t+t,from:l},effects:ka.of(l+t.length),range:V.cursor(l+t.length)};if(e.charCategorizer(l)(u)!=gt.Word&&HN(e,l,i)>-1&&!EDe(e,l,t,i))return{changes:{insert:t+t,from:l},effects:ka.of(l+t.length),range:V.cursor(l+t.length)}}return{range:o=a}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function UN(e,t){let n=xn(e).resolveInner(t+1);return n.parent&&n.from==t}function EDe(e,t,n,r){let i=xn(e).resolveInner(t,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>n.length+l;){if(e.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=i.to==t&&i.parent;if(!u)break;i=u}return!1}function HN(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=gt.Word)return t;for(let i of n){let o=t-i.length;if(e.sliceDoc(o,t)==i&&r(e.sliceDoc(o-1,o))!=gt.Word)return o}return-1}function TDe(e={}){return[gDe,zn,Xt.of(e),pDe,_De,yDe]}const mW=[{key:"Ctrl-Space",run:y1},{mac:"Alt-`",run:y1},{mac:"Alt-i",run:y1},{key:"Escape",run:cDe},{key:"ArrowDown",run:wm(!0)},{key:"ArrowUp",run:wm(!1)},{key:"PageDown",run:wm(!0,"page")},{key:"PageUp",run:wm(!1,"page")},{key:"Enter",run:uDe}],_De=hl.highest(Z0.computeN([Xt],e=>e.facet(Xt).defaultKeymap?[mW]:[]));class VN{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class ua{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(Dd).markerFilter;i&&(t=i(t,r));let o=t.slice().sort((d,p)=>d.from-p.from||d.to-p.to),s=new _o,a=[],l=0,u=r.doc.iter(),c=0,f=r.doc.length;for(let d=0;;){let p=d==o.length?null:o[d];if(!p&&!a.length)break;let m,y;if(a.length)m=l,y=a.reduce((x,k)=>Math.min(x,k.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;y=p.to,a.push(p),d++}for(;d<o.length;){let x=o[d];if(x.from==m&&(x.to>x.from||x.to==m))a.push(x),d++,y=Math.min(x.to,y);else{y=Math.min(x.from,y);break}}y=Math.min(y,f);let g=!1;if(a.some(x=>x.from==m&&(x.to==y||y==f))&&(g=m==y,!g&&y-m<10)){let x=m-(c+u.value.length);x>0&&(u.next(x),c=m);for(let k=m;;){if(k>=y){g=!0;break}if(!u.lineBreak&&c+u.value.length>k)break;k=c+u.value.length,c+=u.value.length,u.next()}}let v=UDe(a);if(g)s.add(m,m,he.widget({widget:new BDe(v),diagnostics:a.slice()}));else{let x=a.reduce((k,w)=>w.markClass?k+" "+w.markClass:k,"");s.add(m,y,he.mark({class:"cm-lintRange cm-lintRange-"+v+x,diagnostics:a.slice(),inclusiveEnd:a.some(k=>k.to>y)}))}if(l=y,l==f)break;for(let x=0;x<a.length;x++)a[x].to<=l&&a.splice(x--,1)}let h=s.finish();return new ua(h,n,Rs(h))}}function Rs(e,t=null,n=0){let r=null;return e.between(n,1e9,(i,o,{spec:s})=>{if(!(t&&s.diagnostics.indexOf(t)<0))if(!r)r=new VN(i,o,t||s.diagnostics[0]);else{if(s.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new VN(r.from,o,r.diagnostic)}}),r}function MDe(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Dd).hideOn(e,n,r);if(i!=null)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(s=>s.is(gW))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}function IDe(e,t){return e.field(xr,!1)?t:t.concat(ke.appendConfig.of(HDe))}const gW=ke.define(),QP=ke.define(),yW=ke.define(),xr=kn.define({create(){return new ua(he.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=Rs(n,e.selected.diagnostic,o)||Rs(n,null,o)}!n.size&&i&&t.state.facet(Dd).autoPanel&&(i=null),e=new ua(n,i,r)}for(let n of t.effects)if(n.is(gW)){let r=t.state.facet(Dd).autoPanel?n.value.length?Ld.open:null:e.panel;e=ua.init(n.value,r,t.state)}else n.is(QP)?e=new ua(e.diagnostics,n.value?Ld.open:null,e.selected):n.is(yW)&&(e=new ua(e.diagnostics,e.panel,n.value));return e},provide:e=>[Td.from(e,t=>t.panel),ie.decorations.from(e,t=>t.diagnostics)]}),jDe=he.mark({class:"cm-lintRange cm-lintRange-active"});function RDe(e,t,n){let{diagnostics:r}=e.state.field(xr),i,o=-1,s=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(l,u,{spec:c})=>{if(t>=l&&t<=u&&(l==u||(t>l||n>0)&&(t<u||n<0)))return i=c.diagnostics,o=l,s=u,!1});let a=e.state.facet(Dd).tooltipFilter;return i&&a&&(i=a(i,e.state)),i?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create(){return{dom:NDe(e,i)}}}:null}function NDe(e,t){return Ue("ul",{class:"cm-tooltip-lint"},t.map(n=>bW(e,n,!1)))}const DDe=e=>{let t=e.state.field(xr,!1);(!t||!t.panel)&&e.dispatch({effects:IDe(e.state,[QP.of(!0)])});let n=MP(e,Ld.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qN=e=>{let t=e.state.field(xr,!1);return!t||!t.panel?!1:(e.dispatch({effects:QP.of(!1)}),!0)},LDe=e=>{let t=e.state.field(xr,!1);if(!t)return!1;let n=e.state.selection.main,r=Rs(t.diagnostics,null,n.to+1);return!r&&(r=Rs(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},$De=[{key:"Mod-Shift-m",run:DDe,preventDefault:!0},{key:"F8",run:LDe}],Dd=se.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Zi(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:KN,tooltipFilter:KN,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,i,o)=>t(r,i,o)||n(r,i,o):t:n,autoPanel:(t,n)=>t||n})}}});function KN(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function vW(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!t.some(o=>o.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function bW(e,t,n){var r;let i=n?vW(t.actions):[];return Ue("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ue("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let p=Rs(e.state.field(xr).diagnostics,t);p&&o.apply(e,p.from,p.to)},{name:u}=o,c=i[s]?u.indexOf(i[s]):-1,f=c<0?u:[u.slice(0,c),Ue("u",u.slice(c,c+1)),u.slice(c+1)],h=o.markClass?" "+o.markClass:"";return Ue("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[s]})"`}.`},f)}),t.source&&Ue("div",{class:"cm-diagnosticSource"},t.source))}class BDe extends Ji{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Ue("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class GN{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bW(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ld{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)qN(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=vW(o.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=Rs(this.view.state.field(xr).diagnostics,o);l&&o.actions[a].apply(t,l.from,l.to)}}else return;i.preventDefault()}},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=Ue("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Ue("div",{class:"cm-panel-lint"},this.list,Ue("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>qN(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(xr).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(xr),r=0,i=!1,o=null,s=new Set;for(t.between(0,this.view.state.doc.length,(a,l,{spec:u})=>{for(let c of u.diagnostics){if(s.has(c))continue;s.add(c);let f=-1,h;for(let d=r;d<this.items.length;d++)if(this.items[d].diagnostic==c){f=d;break}f<0?(h=new GN(this.view,c),this.items.splice(r,0,h),i=!0):(h=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),o=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new GN(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let u=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/u:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(xr),r=Rs(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:yW.of(r)})}static open(t){return new Ld(t)}}function FDe(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Sm(e){return FDe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const zDe=ie.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Sm("#d11")},".cm-lintRange-warning":{backgroundImage:Sm("orange")},".cm-lintRange-info":{backgroundImage:Sm("#999")},".cm-lintRange-hint":{backgroundImage:Sm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function WDe(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function UDe(e){let t="hint",n=1;for(let r of e){let i=WDe(r.severity);i>n&&(n=i,t=r.severity)}return t}const HDe=[xr,ie.decorations.compute([xr],e=>{let{selected:t,panel:n}=e.field(xr);return!t||!n||t.from==t.to?he.none:he.set([jDe.range(t.from,t.to)])}),RIe(RDe,{hideOn:MDe}),zDe];var QN=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(SDe)),t.defaultKeymap!==!1&&(r=r.concat(pNe)),t.searchKeymap!==!1&&(r=r.concat(zNe)),t.historyKeymap!==!1&&(r=r.concat(wRe)),t.foldKeymap!==!1&&(r=r.concat(Nje)),t.completionKeymap!==!1&&(r=r.concat(mW)),t.lintKeymap!==!1&&(r=r.concat($De));var i=[];return t.lineNumbers!==!1&&i.push(KIe()),t.highlightActiveLineGutter!==!1&&i.push(XIe()),t.highlightSpecialChars!==!1&&i.push(uIe()),t.history!==!1&&i.push(hRe()),t.foldGutter!==!1&&i.push(Bje()),t.drawSelection!==!1&&i.push(ZMe()),t.dropCursor!==!1&&i.push(rIe()),t.allowMultipleSelections!==!1&&i.push(_e.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&i.push(Cje()),t.syntaxHighlighting!==!1&&i.push(m9(Uje,{fallback:!0})),t.bracketMatching!==!1&&i.push(Xje()),t.closeBrackets!==!1&&i.push(vDe()),t.autocompletion!==!1&&i.push(TDe()),t.rectangularSelection!==!1&&i.push(kIe()),n!==!1&&i.push(AIe()),t.highlightActiveLine!==!1&&i.push(mIe()),t.highlightSelectionMatches!==!1&&i.push(xNe()),t.tabSize&&typeof t.tabSize=="number"&&i.push(eb.of(" ".repeat(t.tabSize))),i.concat([Z0.of(r.flat())]).filter(Boolean)};const VDe="#e5c07b",XN="#e06c75",qDe="#56b6c2",KDe="#ffffff",Zm="#abb2bf",xO="#7d8799",GDe="#61afef",QDe="#98c379",YN="#d19a66",XDe="#c678dd",YDe="#21252b",ZN="#2c313a",JN="#282c34",b1="#353a42",ZDe="#3E4451",eD="#528bff",JDe=ie.theme({"&":{color:Zm,backgroundColor:JN},".cm-content":{caretColor:eD},".cm-cursor, .cm-dropCursor":{borderLeftColor:eD},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ZDe},".cm-panels":{backgroundColor:YDe,color:Zm},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:JN,color:xO,border:"none"},".cm-activeLineGutter":{backgroundColor:ZN},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:b1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:b1,borderBottomColor:b1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ZN,color:Zm}}},{dark:!0}),eLe=lp.define([{tag:W.keyword,color:XDe},{tag:[W.name,W.deleted,W.character,W.propertyName,W.macroName],color:XN},{tag:[W.function(W.variableName),W.labelName],color:GDe},{tag:[W.color,W.constant(W.name),W.standard(W.name)],color:YN},{tag:[W.definition(W.name),W.separator],color:Zm},{tag:[W.typeName,W.className,W.number,W.changed,W.annotation,W.modifier,W.self,W.namespace],color:VDe},{tag:[W.operator,W.operatorKeyword,W.url,W.escape,W.regexp,W.link,W.special(W.string)],color:qDe},{tag:[W.meta,W.comment],color:xO},{tag:W.strong,fontWeight:"bold"},{tag:W.emphasis,fontStyle:"italic"},{tag:W.strikethrough,textDecoration:"line-through"},{tag:W.link,color:xO,textDecoration:"underline"},{tag:W.heading,fontWeight:"bold",color:XN},{tag:[W.atom,W.bool,W.special(W.variableName)],color:YN},{tag:[W.processingInstruction,W.string,W.inserted],color:QDe},{tag:W.invalid,color:KDe}]),tLe=[JDe,m9(eLe)];var nLe=ie.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),rLe=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=t,l=[];switch(n&&l.unshift(Z0.of([mNe])),a&&(typeof a=="boolean"?l.unshift(QN()):l.unshift(QN(a))),s&&l.unshift(bIe(s)),o){case"light":l.push(nLe);break;case"dark":l.push(tLe);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(ie.editable.of(!1)),i&&l.push(_e.readOnly.of(!0)),[...l]},iLe=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class oLe{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class tD{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var x1=null,sLe=()=>typeof window>"u"?new tD:(x1||(x1=new tD),x1),nD=Yi.define(),aLe=200,lLe=[];function uLe(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=lLe,autoFocus:l,theme:u="light",height:c=null,minHeight:f=null,maxHeight:h=null,width:d=null,minWidth:p=null,maxWidth:m=null,placeholder:y="",editable:g=!0,readOnly:v=!1,indentWithTab:x=!0,basicSetup:k=!0,root:w,initialState:S}=e,[O,A]=C.useState(),[P,M]=C.useState(),[_,E]=C.useState(),R=C.useState(()=>({current:null}))[0],N=C.useState(()=>({current:null}))[0],j=ie.theme({"&":{height:c,minHeight:f,maxHeight:h,width:d,minWidth:p,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),B=ie.updateListener.of(z=>{if(z.docChanged&&typeof r=="function"&&!z.transactions.some(D=>D.annotation(nD))){R.current?R.current.reset():(R.current=new oLe(()=>{if(N.current){var D=N.current;N.current=null,D()}R.current=null},aLe),sLe().add(R.current));var T=z.state.doc,q=T.toString();r(q,z)}i&&i(iLe(z))}),F=rLe({theme:u,editable:g,readOnly:v,placeholder:y,indentWithTab:x,basicSetup:k}),$=[B,j,...F];return s&&typeof s=="function"&&$.push(ie.updateListener.of(s)),$=$.concat(a),C.useLayoutEffect(()=>{if(O&&!_){var z={doc:t,selection:n,extensions:$},T=S?_e.fromJSON(S.json,z,S.fields):_e.create(z);if(E(T),!P){var q=new ie({state:T,parent:O,root:w});M(q),o&&o(q,T)}}return()=>{P&&(E(void 0),M(void 0))}},[O,_]),C.useEffect(()=>{e.container&&A(e.container)},[e.container]),C.useEffect(()=>()=>{P&&(P.destroy(),M(void 0)),R.current&&(R.current.cancel(),R.current=null)},[P]),C.useEffect(()=>{l&&P&&P.focus()},[l,P]),C.useEffect(()=>{P&&P.dispatch({effects:ke.reconfigure.of($)})},[u,a,c,f,h,d,p,m,y,g,v,x,k,r,s]),C.useEffect(()=>{if(t!==void 0){var z=P?P.state.doc.toString():"";if(P&&t!==z){var T=R.current&&!R.current.isDone,q=()=>{P&&t!==P.state.doc.toString()&&P.dispatch({changes:{from:0,to:P.state.doc.toString().length,insert:t||""},annotations:[nD.of(!0)]})};T?N.current=q:q()}}},[t,P]),{state:_,setState:E,view:P,setView:M,container:O,setContainer:A}}var cLe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],xW=C.forwardRef((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,autoFocus:c,theme:f="light",height:h,minHeight:d,maxHeight:p,width:m,minWidth:y,maxWidth:g,basicSetup:v,placeholder:x,indentWithTab:k,editable:w,readOnly:S,root:O,initialState:A}=e,P=Gye(e,cLe),M=C.useRef(null),{state:_,view:E,container:R,setContainer:N}=uLe({root:O,value:r,autoFocus:c,theme:f,height:h,minHeight:d,maxHeight:p,width:m,minWidth:y,maxWidth:g,basicSetup:v,placeholder:x,indentWithTab:k,editable:w,readOnly:S,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,extensions:o,initialState:A});C.useImperativeHandle(t,()=>({editor:M.current,state:_,view:E}),[M,R,_,E]);var j=C.useCallback(F=>{M.current=F,N(F)},[N]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var B=typeof f=="string"?"cm-theme-"+f:"cm-theme";return b.jsx("div",DS({ref:j,className:""+B+(n?" "+n:"")},P))});xW.displayName="CodeMirror";var rD={};class gv{constructor(t,n,r,i,o,s,a,l,u,c=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=u,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new gv(t,[],n,r,r,0,[],0,i?new iD(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=o.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){i<o.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(t&262144?6:0),u=l?this.stack[l-2]:this.p.ranges[0].from;i<o.minRepeatTerm&&u==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-u;c>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=u,this.p.lastBigReductionSize=c));let f=l?this.stack[l-1]:0,h=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||t&131072){let d=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,u,d,h+4,!0)}if(t&262144)this.state=this.stack[l];else{let d=this.stack[l-3];this.state=o.getGoto(d,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,u)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this.buffer.length;if(s>0&&this.buffer[s-4]==0&&this.buffer[s-1]>-1){if(n==r)return;if(this.buffer[s-2]>=n){this.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=t,{parser:s}=this.p;this.pos=i;let a=s.stateFlag(o,1);!a&&(i>r||n<=s.maxNode)&&(this.reducePos=i),this.pushState(o,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new gv(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new fLe(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,t)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if(!(n&65536))return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,u=this.stack.length-a*3;if(u>=0&&t.getGoto(this.stack[u],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new iD(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class iD{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class fLe{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class yv{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new yv(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new yv(this.stack,this.pos,this.index)}}function km(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let s=e.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class Jm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const oD=new Jm;class hLe{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=oD,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(t,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=oD,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class Ou{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;dLe(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}Ou.prototype.contextual=Ou.prototype.fallback=Ou.prototype.extend=!1;Ou.prototype.fallback=Ou.prototype.extend=!1;class lb{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function dLe(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&e[s];){let u=e[s+1];for(let d=s+3;d<u;d+=2)if((e[d+1]&a)>0){let p=e[d];if(l.allows(p)&&(t.token.value==-1||t.token.value==p||pLe(p,t.token.value,i,o))){t.acceptToken(p);break}}let c=t.next,f=0,h=e[s+2];if(t.next<0&&h>f&&e[u+h*3-3]==65535){s=e[u+h*3-1];continue e}for(;f<h;){let d=f+h>>1,p=u+d+(d<<1),m=e[p],y=e[p+1]||65536;if(c<m)h=d;else if(c>=y)f=d+1;else{s=e[p+2],t.advance();continue e}}break}}function sD(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function pLe(e,t,n,r){let i=sD(n,r,t);return i<0||sD(n,r,e)<i}const lr=typeof process<"u"&&rD&&/\bparse\b/.test(rD.LOG);let w1=null;function aD(e,t,n){let r=e.cursor(St.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class mLe{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?aD(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?aD(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>t)return this.nextStart=s,null;if(o instanceof Tt){if(s==t){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(Ae.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class gLe{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new Jm)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let u=0;u<o.length;u++){if(!(1<<u&s))continue;let c=o[u],f=this.tokens[u];if(!(r&&!c.fallback)&&((c.contextual||f.start!=t.pos||f.mask!=s||f.context!=a)&&(this.updateCachedToken(f,c,t),f.mask=s,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!c.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new Jm,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new Jm,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==t.value){let a=o.specializers[s](this.stream.read(t.start,t.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?t.extended=a>>1:t.value=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:o}=t,{parser:s}=t.p,{data:a}=s;for(let l=0;l<2;l++)for(let u=s.stateSlot(o,l?2:1);;u+=3){if(a[u]==65535)if(a[u+1]==1)u=ao(a,u+2);else{i==0&&a[u+1]==2&&(i=this.putAction(ao(a,u+2),n,r,i));break}a[u]==n&&(i=this.putAction(ao(a,u+1),n,r,i))}return i}}class yLe{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new hLe(n,i),this.tokens=new gLe(t,this.stream),this.topTerm=t.top[1];let{from:o}=i[0];this.stacks=[gv.start(this,t.top[0],o)],this.fragments=r.length&&this.stream.end-o>t.bufferLength*4?new mLe(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<t.length;s++){let a=t[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&xLe(i);if(s)return lr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw lr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return lr&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let u=r[l];if(a.sameState(u)||a.buffer.length>500&&u.buffer.length>500)if((a.score-u.score||a.buffer.length-u.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&(r.sort((s,a)=>a.score-s.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:o}=this,s=lr?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let u=t.curContext&&t.curContext.tracker.strict,c=u?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(Ae.contextHash)||0)==c))return t.useNode(f,h),lr&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof Tt)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof Tt&&f.positions[0]==0)f=d;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),lr&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let u=0;u<l.length;){let c=l[u++],f=l[u++],h=l[u++],d=u==l.length||!r,p=d?t:t.split(),m=this.tokens.mainToken;if(p.apply(c,f,m?m.start:p.pos,h),lr&&console.log(s+this.stackID(p)+` (via ${c&65536?`reduce of ${o.getName(c&65535)}`:"shift"} for ${o.getName(f)} @ ${i}${p==t?"":", split"})`),d)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return lD(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s<t.length;s++){let a=t[s],l=n[s<<1],u=n[(s<<1)+1],c=lr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),lr&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),h=c;for(let d=0;d<10&&f.forceReduce()&&(lr&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));d++)lr&&(h=this.stackID(f)+" -> ");for(let d of a.recoverByInsert(l))lr&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,r);this.stream.end>a.pos?(u==a.pos&&(u++,l=0),a.recoverByDelete(l,u),lr&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),lD(a,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(t){return t.close(),Tt.build({buffer:yv.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(w1||(w1=new WeakMap)).get(t);return n||w1.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function lD(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class vLe{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const S1=e=>e;class bLe{constructor(t){this.start=t.start,this.shift=t.shift||S1,this.reduce=t.reduce||S1,this.reuse=t.reuse||S1,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class vv extends Z6{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<t.repeatNodeCount;a++)n.push("");let r=Object.keys(t.topRules).map(a=>t.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,u){i[a].push([l,l.deserialize(String(u))])}if(t.nodeProps)for(let a of t.nodeProps){let l=a[0];typeof l=="string"&&(l=Ae[l]);for(let u=1;u<a.length;){let c=a[u++];if(c>=0)o(c,l,a[u++]);else{let f=a[u+-c];for(let h=-c;h>0;h--)o(a[u++],l,f);u++}}}this.nodeSet=new IP(n.map((a,l)=>tr.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=G6;let s=km(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(uD),this.states=km(t.states,Uint32Array),this.data=km(t.stateData),this.goto=km(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(a=>typeof a=="number"?new Ou(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new yLe(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let u=o+(s>>1);o<u;o++)if(i[o]==t)return l;if(a)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(t,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=ao(r,o+2)];else{if(r[o+1]==2)return ao(r,o+2);break}if(s==n||s==0)return ao(r,o+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=ao(this.data,o+2);else break;i=n(ao(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ao(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(vv.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=uD(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new vLe(t,r,i)}static deserialize(t){return new vv(t)}}function ao(e,t){return e[t]|e[t+1]<<16}function xLe(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function uD(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const Rl=63,cD=64,wLe=1,SLe=2,wW=3,kLe=4,SW=5,OLe=6,CLe=7,kW=65,ALe=66,PLe=8,ELe=9,TLe=10,_Le=11,MLe=12,OW=13,ILe=19,jLe=20,RLe=29,NLe=33,DLe=34,LLe=47,$Le=0,XP=1,wO=2,$d=3,SO=4;class ca{constructor(t,n,r){this.parent=t,this.depth=n,this.type=r,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+r}}ca.top=new ca(null,-1,$Le);function uh(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let i=e.peek(r);if(jo(i)||i==-1)return n}}function kO(e){return e==32||e==9}function jo(e){return e==10||e==13}function CW(e){return kO(e)||jo(e)}function Oa(e){return e<0||CW(e)}const BLe=new bLe({start:ca.top,reduce(e,t){return e.type==$d&&(t==jLe||t==DLe)?e.parent:e},shift(e,t,n,r){if(t==wW)return new ca(e,uh(r,r.pos),XP);if(t==kW||t==SW)return new ca(e,uh(r,r.pos),wO);if(t==Rl)return e.parent;if(t==ILe||t==NLe)return new ca(e,0,$d);if(t==OW&&e.type==SO)return e.parent;if(t==LLe){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new ca(e,e.depth+ +i[0],SO)}return e},hash(e){return e.hash}});function gc(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Oa(e.peek(n+3))}const FLe=new lb((e,t)=>{if(e.next==-1&&t.canShift(cD))return e.acceptToken(cD);let n=e.peek(-1);if((jo(n)||n<0)&&t.context.type!=$d){if(gc(e,45))if(t.canShift(Rl))e.acceptToken(Rl);else return e.acceptToken(wLe,3);if(gc(e,46))if(t.canShift(Rl))e.acceptToken(Rl);else return e.acceptToken(SLe,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==XP&&(e.next!=45||!Oa(e.peek(1))))&&e.next!=-1&&!jo(e.next)&&e.next!=35&&e.acceptToken(Rl,-r)}},{contextual:!0}),zLe=new lb((e,t)=>{if(t.context.type==$d){e.next==63&&(e.advance(),Oa(e.next)&&e.acceptToken(CLe));return}if(e.next==45)e.advance(),Oa(e.next)&&e.acceptToken(t.context.type==XP&&t.context.depth==uh(e,e.pos-1)?kLe:wW);else if(e.next==63)e.advance(),Oa(e.next)&&e.acceptToken(t.context.type==wO&&t.context.depth==uh(e,e.pos-1)?OLe:SW);else{let n=e.pos;for(;;)if(kO(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)AW(e);else if(e.next==38)OO(e);else if(e.next==42){OO(e);break}else if(e.next==39||e.next==34){if(YP(e,!0))break;return}else if(e.next==91||e.next==123){if(!ULe(e))return;break}else{PW(e,!0,!1,0);break}for(;kO(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(RLe))return;let r=e.peek(1);Oa(r)&&e.acceptTokenTo(t.context.type==wO&&t.context.depth==uh(e,n)?ALe:kW,n)}}},{contextual:!0});function WLe(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function fD(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function hD(e,t){return e.next==37?(e.advance(),fD(e.next)&&e.advance(),fD(e.next)&&e.advance(),!0):WLe(e.next)||t&&e.next==44?(e.advance(),!0):!1}function AW(e){if(e.advance(),e.next==60){for(e.advance();;)if(!hD(e,!0)){e.next==62&&e.advance();break}}else for(;hD(e,!1););}function OO(e){for(e.advance();!Oa(e.next)&&bv(e.next)!="f";)e.advance()}function YP(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let o=e.next;if(o<0)break;if(e.advance(),o==n)if(o==39)if(e.next==39)e.advance();else break;else break;else if(o==92&&n==34)e.next>=0&&e.advance();else if(jo(o)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function ULe(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!YP(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||jo(e.next))return!1;e.advance()}}const HLe="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function bv(e){return e<33?"u":e>125?"s":HLe[e-33]}function k1(e,t){let n=bv(e);return n!="u"&&!(t&&n=="f")}function PW(e,t,n,r){if(bv(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&k1(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let o=e.next,s=0,a=r+1;for(;CW(o);){if(jo(o)){if(t)return!1;a=0}else a++;o=e.peek(++s)}if(!(o>=0&&(o==58?k1(e.peek(s+1),n):o==35?e.peek(s-1)!=32:k1(o,n)))||!n&&a<=r||a==0&&!n&&(gc(e,45,s)||gc(e,46,s)))break;if(t&&bv(o)=="f")return!1;for(let u=s;u>=0;u--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}const VLe=new lb((e,t)=>{if(e.next==33)AW(e),e.acceptToken(MLe);else if(e.next==38||e.next==42){let n=e.next==38?TLe:_Le;OO(e),e.acceptToken(n)}else e.next==39||e.next==34?(YP(e,!1),e.acceptToken(ELe)):PW(e,!1,t.context.type==$d,t.context.depth)&&e.acceptToken(PLe)}),qLe=new lb((e,t)=>{let n=t.context.type==SO?t.context.depth:-1,r=e.pos;e:for(;;){let i=0,o=e.next;for(;o==32;)o=e.peek(++i);if(!i&&(gc(e,45,i)||gc(e,46,i))||!jo(o)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break e;let s=jo(e.next);if(e.advance(),s)continue e;r=e.pos}}e.acceptTokenTo(OW,r)}),KLe=J6({DirectiveName:W.keyword,DirectiveContent:W.attributeValue,"DirectiveEnd DocEnd":W.meta,QuotedLiteral:W.string,BlockLiteralHeader:W.special(W.string),BlockLiteralContent:W.content,Literal:W.content,"Key/Literal Key/QuotedLiteral":W.definition(W.propertyName),"Anchor Alias":W.labelName,Tag:W.typeName,Comment:W.lineComment,": , -":W.separator,"?":W.punctuation,"[ ]":W.squareBracket,"{ }":W.brace}),GLe=vv.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:BLe,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[KLe],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[FLe,zLe,VLe,qLe,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),QLe=rv.define({name:"yaml",parser:GLe.configure({props:[r9.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.from<t.to)return e.baseIndentFor(t);if(t.name=="BlockLiteral")return e.baseIndentFor(t)+e.unit;if(t.name=="BlockSequence"||t.name=="BlockMapping")return e.column(t.firstChild.from,1);if(t.name=="QuotedLiteral")return null;if(t.name=="Literal"){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:bN({closing:"}"}),FlowSequence:bN({closing:"]"})}),s9.add({"FlowMapping FlowSequence":Pje,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function XLe(){return new gje(QLe)}function Ct({label:e,helper:t,error:n,required:r,children:i}){const o=C.useId(),s=`${o}-input`,a=`${o}-helper`,l=`${o}-error`;return b.jsxs("div",{className:"flex flex-col gap-1.5",children:[b.jsxs("label",{htmlFor:s,className:"text-[12px] font-medium text-[var(--color-text)]",children:[e,r?b.jsx("span",{className:"ml-0.5 text-[var(--color-fail)]",children:"*"}):null]}),i({id:s,helperId:a,errorId:l}),n?b.jsx("p",{id:l,className:"text-[12px] text-[var(--color-fail)]",children:n}):t?b.jsx("p",{id:a,className:"text-[12px] text-[var(--color-text-muted)]",children:t}):null]})}const kf={enabled:!1,provider:"anthropic",mode:"auto",budget:{maxFileReads:25,maxContextBytes:5e4,maxDurationSeconds:180},cache:{enabled:!0},maxOutputTokens:16384};function YLe(){const e=Qi(),{toast:t}=Do(),n=Jt({queryKey:["config"],queryFn:()=>Be("/api/config")}),[r,i]=C.useState(null),[o,s]=C.useState(null);C.useEffect(()=>{n.data&&i(structuredClone(n.data))},[n.data]);const a=Wa({mutationFn:f=>Be("/api/config",{method:"PUT",body:JSON.stringify(f)}),onSuccess:()=>{s(null),e.invalidateQueries({queryKey:["config"]}),e.invalidateQueries({queryKey:["meta"]}),t({tone:"success",title:"Config saved"})},onError:f=>s(f.message)}),l=C.useMemo(()=>r?F_e.dump(r,{lineWidth:100,noRefs:!0,sortKeys:!1}):"",[r]);if(n.isPending||!r)return b.jsx(Fe,{title:"Config",description:"Visual editor for .squad/config.yaml.",children:b.jsx(Nr,{className:"h-96 w-full"})});const u=r.planner?{...kf,...r.planner,budget:{...kf.budget,...r.planner.budget}}:{...kf,enabled:!1};function c(f){i(h=>h&&{...h,planner:f})}return b.jsxs(Fe,{title:"Config",description:"Edit workspace settings. Saving runs the same validation as the CLI. YAML tab is read-only — use your editor for raw edits.",children:[o?b.jsx(Ge,{tone:"danger",title:"Could not save",children:o}):null,b.jsx(sP,{tabs:[{id:"form",label:"Form",panel:b.jsxs("div",{className:"space-y-4",children:[b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold text-[var(--color-text)]",children:"Project"}),b.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[b.jsx(Ct,{label:"Name",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,value:r.project.name,onChange:d=>i({...r,project:{...r.project,name:d.target.value}})})}),b.jsx(Ct,{label:"Primary language",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,value:r.project.primaryLanguage??"",onChange:d=>i({...r,project:{...r.project,primaryLanguage:d.target.value}})})}),b.jsx("div",{className:"sm:col-span-2",children:b.jsx(Ct,{label:"Project roots (comma-separated)",helper:"Paths relative to the workspace root.",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,className:"font-mono",value:(r.project.projectRoots??["."]).join(", "),onChange:d=>i({...r,project:{...r.project,projectRoots:d.target.value.split(",").map(p=>p.trim()).filter(Boolean)}})})})})]})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Tracker"}),b.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[b.jsx("div",{className:"sm:col-span-2",children:b.jsx(Ct,{label:"Type",children:({id:f,helperId:h})=>b.jsxs(ac,{id:f,"aria-describedby":h,className:"mt-0 w-full",value:r.tracker.type,onChange:d=>i({...r,tracker:{...r.tracker,type:d.target.value}}),children:[b.jsx("option",{value:"none",children:"none"}),b.jsx("option",{value:"github",children:"github"}),b.jsx("option",{value:"linear",children:"linear"}),b.jsx("option",{value:"jira",children:"jira"}),b.jsx("option",{value:"azure",children:"azure"})]})})}),b.jsx(Ct,{label:"Workspace",helper:"Jira host or Azure org.",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,placeholder:"host (Jira) or org (Azure)",value:r.tracker.workspace??"",onChange:d=>i({...r,tracker:{...r.tracker,workspace:d.target.value||void 0}})})}),b.jsx(Ct,{label:"Project",helper:"Azure project name if applicable.",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,placeholder:"Azure project name if applicable",value:r.tracker.project??"",onChange:d=>i({...r,tracker:{...r.tracker,project:d.target.value||void 0}})})})]})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Naming"}),b.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:r.naming.includeTrackerId,onChange:f=>i({...r,naming:{...r.naming,includeTrackerId:f.target.checked}})}),"includeTrackerId"]}),b.jsxs("label",{className:"mt-2 flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:r.naming.globalSequence,onChange:f=>i({...r,naming:{...r.naming,globalSequence:f.target.checked}})}),"globalSequence"]})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Agents"}),b.jsx(Ct,{label:"Agent ids",helper:"One id per line.",children:({id:f,helperId:h})=>b.jsx("textarea",{id:f,"aria-describedby":h,className:"w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-bg-elevated)] px-3 py-2 font-mono text-sm text-[var(--color-text)]",rows:4,placeholder:"One agent id per line",value:r.agents.join(`
415
+ `),onChange:d=>i({...r,agents:d.target.value.split(`
416
+ `).map(p=>p.trim()).filter(Boolean)})})})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Planner"}),b.jsxs("label",{className:"mb-2 flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:u.enabled,onChange:f=>{f.target.checked?c({...kf,...r.planner,enabled:!0,budget:{...kf.budget,...r.planner?.budget}}):c({...u,enabled:!1})}}),"Enabled"]}),u.enabled&&b.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[b.jsx(Ct,{label:"Provider",children:({id:f,helperId:h})=>b.jsxs(ac,{id:f,"aria-describedby":h,className:"w-full",value:u.provider,onChange:d=>c({...u,provider:d.target.value}),children:[b.jsx("option",{value:"anthropic",children:"anthropic"}),b.jsx("option",{value:"openai",children:"openai"}),b.jsx("option",{value:"google",children:"google"})]})}),b.jsx(Ct,{label:"Max output tokens",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,type:"number",value:u.maxOutputTokens??16384,onChange:d=>c({...u,maxOutputTokens:Number(d.target.value)||16384})})}),b.jsx("div",{className:"sm:col-span-2",children:b.jsx(Ct,{label:"Model overrides (optional)",helper:"Provider → model id.",children:({id:f,helperId:h})=>b.jsxs("div",{id:f,"aria-describedby":h,className:"mt-0 grid gap-2 sm:grid-cols-3",children:[b.jsx(ut,{placeholder:"anthropic",className:"font-mono text-xs",value:u.modelOverride?.anthropic??"",onChange:d=>c({...u,modelOverride:{...u.modelOverride,anthropic:d.target.value||void 0}})}),b.jsx(ut,{placeholder:"openai",className:"font-mono text-xs",value:u.modelOverride?.openai??"",onChange:d=>c({...u,modelOverride:{...u.modelOverride,openai:d.target.value||void 0}})}),b.jsx(ut,{placeholder:"google",className:"font-mono text-xs",value:u.modelOverride?.google??"",onChange:d=>c({...u,modelOverride:{...u.modelOverride,google:d.target.value||void 0}})})]})})}),b.jsx(Ct,{label:"Budget: max file reads",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,type:"number",value:u.budget.maxFileReads,onChange:d=>c({...u,budget:{...u.budget,maxFileReads:Number(d.target.value)||1}})})}),b.jsx(Ct,{label:"Max context bytes",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,type:"number",value:u.budget.maxContextBytes,onChange:d=>c({...u,budget:{...u.budget,maxContextBytes:Number(d.target.value)||1}})})}),b.jsx(Ct,{label:"Max duration (sec)",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,type:"number",value:u.budget.maxDurationSeconds,onChange:d=>c({...u,budget:{...u.budget,maxDurationSeconds:Number(d.target.value)||1}})})}),b.jsx("div",{className:"sm:col-span-2",children:b.jsx(Ct,{label:"Max cost USD (optional)",children:({id:f,helperId:h})=>b.jsx(ut,{id:f,"aria-describedby":h,type:"number",step:"0.01",value:u.budget.maxCostUsd??"",onChange:d=>{const p=d.target.value;c({...u,budget:{...u.budget,maxCostUsd:p===""?void 0:Number(p)}})}})})}),b.jsxs("label",{className:"flex items-center gap-2 text-sm sm:col-span-2",children:[b.jsx("input",{type:"checkbox",checked:u.cache?.enabled!==!1,onChange:f=>c({...u,cache:{enabled:f.target.checked}})}),"Prompt cache enabled"]})]})]}),b.jsx("div",{className:"flex justify-end",children:b.jsx(be,{type:"button",onClick:()=>a.mutate({...r,planner:u}),loading:a.isPending,children:"Save changes"})})]})},{id:"yaml",label:"YAML",panel:b.jsx("div",{className:"overflow-hidden rounded-lg border border-[var(--color-border)]",children:b.jsx(xW,{value:l,height:"min(60vh, 480px)",theme:"dark",extensions:[XLe()],editable:!1})})}]})]})}async function O1(e){const t=sessionStorage.getItem("squad.console.token");if(!t)throw new $r;const n=await fetch(e,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"}});if(n.status===401)throw new $r;return await n.json()}function Of({label:e,helper:t,display:n,onSave:r}){const[i,o]=C.useState(!1),[s,a]=C.useState("");return i?b.jsx(Ct,{label:e,helper:t,children:({id:l,helperId:u})=>b.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[b.jsx(ut,{id:l,"aria-describedby":u,type:"password",className:"flex-1",value:s,onChange:c=>a(c.target.value),autoComplete:"off"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx(be,{type:"button",onClick:()=>{r(s),o(!1),a("")},children:"Save"}),b.jsx(be,{type:"button",variant:"secondary",onClick:()=>{o(!1),a("")},children:"Cancel"})]})]})}):b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] font-medium text-[var(--color-text)]",children:e}),b.jsx("p",{className:"text-[12px] text-[var(--color-text-muted)]",children:t}),b.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[b.jsx("code",{className:"max-w-full break-all rounded bg-[var(--color-surface)] px-2 py-1 text-sm",children:n??"—"}),b.jsx(be,{type:"button",variant:"secondary",onClick:()=>{a(""),o(!0)},children:"Edit"})]})]})}function ZLe(){const e=Qi(),{toast:t}=Do(),[n,r]=C.useState(null),[i,o]=C.useState(""),[s,a]=C.useState(""),[l,u]=C.useState(""),[c,f]=C.useState(""),[h,d]=C.useState(null),[p,m]=C.useState(null),[y,g]=C.useState(null),[v,x]=C.useState(null),[k,w]=C.useState(null),[S,O]=C.useState(null),A=Jt({queryKey:["secrets"],queryFn:()=>Be("/api/secrets")}),P=C.useRef(!1),M=Wa({mutationFn:j=>Be("/api/secrets",{method:"PUT",body:JSON.stringify(j)}),onSuccess:()=>{r(null),e.invalidateQueries({queryKey:["secrets"]}),t({tone:"success",title:"Secrets saved"})},onError:j=>r(j.message)});C.useEffect(()=>{!A.data||P.current||(P.current=!0,o(A.data.tracker.jira.host??""),a(A.data.tracker.jira.email??""),u(A.data.tracker.azure.organization??""),f(A.data.tracker.azure.project??""))},[A.data]);async function _(j,B){O(j),B(null);try{const F=await O1(`/api/secrets/test/${j}`);if(F&&"ok"in F&&F.ok)B({ok:!0,message:`${F.modelCount} models accessible`});else{const $=F.detail??"failed",z=F.status;B({ok:!1,message:z?`HTTP ${z} — ${$}`:String($)})}}catch(F){B({ok:!1,message:F.message})}finally{O(null)}}async function E(){O("jira"),x(null);try{const j=await O1("/api/secrets/test/jira");j.ok?x({ok:!0,message:"Jira reachable"}):x({ok:!1,message:j.detail?`Jira: ${j.detail}`:"unreachable"})}catch(j){x({ok:!1,message:j.message})}finally{O(null)}}async function R(){O("azure"),w(null);try{const j=await O1("/api/secrets/test/azure");j.ok?w({ok:!0,message:"Azure DevOps reachable"}):w({ok:!1,message:j.detail?`Azure: ${j.detail}`:"unreachable"})}catch(j){w({ok:!1,message:j.message})}finally{O(null)}}if(A.isPending||!A.data)return b.jsx(Fe,{title:"Secrets",description:"Stored in .squad/secrets.yaml. Never committed.",children:b.jsx("p",{className:"text-[var(--color-text-muted)]",children:"Loading…"})});const N=A.data;return b.jsxs(Fe,{title:"Secrets",description:"Stored in .squad/secrets.yaml. Never committed.",children:[b.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Values are masked on read. For provider tests, save the key first, then test (the server only uses stored secrets)."}),n?b.jsx(Ge,{tone:"danger",children:n}):null,b.jsxs("div",{className:"space-y-4",children:[b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Planner"}),b.jsxs("div",{className:"space-y-4",children:[b.jsx(Of,{label:"Anthropic API key",helper:"Stored in .squad/secrets.yaml; never committed.",display:N.planner.anthropic,onSave:j=>M.mutate({planner:{anthropic:j}})}),h?b.jsx(Et,{tone:h.ok?"success":"danger",children:h.ok?"reachable":"failed"}):null,b.jsx("div",{className:"flex flex-wrap gap-2",children:b.jsx(be,{type:"button",variant:"secondary",size:"sm",loading:S==="anthropic",onClick:async()=>{d(null),await _("anthropic",d)},children:"Test connection"})}),b.jsx(Of,{label:"OpenAI API key",helper:"Stored in .squad/secrets.yaml; never committed.",display:N.planner.openai,onSave:j=>M.mutate({planner:{openai:j}})}),p?b.jsx(Et,{tone:p.ok?"success":"danger",children:p.ok?"reachable":"failed"}):null,b.jsx(be,{type:"button",variant:"secondary",size:"sm",loading:S==="openai",onClick:async()=>{m(null),await _("openai",m)},children:"Test connection"}),b.jsx(Of,{label:"Google API key",helper:"Stored in .squad/secrets.yaml; never committed.",display:N.planner.google,onSave:j=>M.mutate({planner:{google:j}})}),y?b.jsx(Et,{tone:y.ok?"success":"danger",children:y.ok?"reachable":"failed"}):null,b.jsx(be,{type:"button",variant:"secondary",size:"sm",loading:S==="google",onClick:async()=>{g(null),await _("google",g)},children:"Test connection"})]})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Jira"}),b.jsxs("div",{className:"grid max-w-lg gap-3",children:[b.jsx(Ct,{label:"Host",children:({id:j,helperId:B})=>b.jsx(ut,{id:j,"aria-describedby":B,className:"mt-0",value:i,onChange:F=>o(F.target.value)})}),b.jsx(Ct,{label:"Email",children:({id:j,helperId:B})=>b.jsx(ut,{id:j,"aria-describedby":B,className:"mt-0",value:s,onChange:F=>a(F.target.value)})}),b.jsx(Of,{label:"Token",helper:"Jira API token; stored in secrets.",display:N.tracker.jira.token,onSave:j=>M.mutate({tracker:{jira:{token:j}}})}),b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx(be,{type:"button",onClick:()=>M.mutate({tracker:{jira:{host:i,email:s}}}),loading:M.isPending,children:"Save Jira fields"}),b.jsx(be,{type:"button",variant:"secondary",loading:S==="jira"||M.isPending,onClick:async()=>{x(null);try{await M.mutateAsync({tracker:{jira:{host:i,email:s}}}),await E()}catch{}},children:"Save and test"})]}),v?b.jsx(Et,{tone:v.ok?"success":"danger",children:v.message}):null]})]}),b.jsxs(nt,{variant:"default",children:[b.jsx("h2",{className:"mb-3 text-sm font-semibold",children:"Azure"}),b.jsxs("div",{className:"grid max-w-lg gap-3",children:[b.jsx(Ct,{label:"Organization",children:({id:j,helperId:B})=>b.jsx(ut,{id:j,"aria-describedby":B,className:"mt-0",value:l,onChange:F=>u(F.target.value)})}),b.jsx(Ct,{label:"Project",children:({id:j,helperId:B})=>b.jsx(ut,{id:j,"aria-describedby":B,className:"mt-0",value:c,onChange:F=>f(F.target.value)})}),b.jsx(Of,{label:"PAT",helper:"Azure DevOps personal access token.",display:N.tracker.azure.pat,onSave:j=>M.mutate({tracker:{azure:{pat:j}}})}),b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx(be,{type:"button",onClick:()=>M.mutate({tracker:{azure:{organization:l,project:c}}}),loading:M.isPending,children:"Save Azure fields"}),b.jsx(be,{type:"button",variant:"secondary",loading:S==="azure"||M.isPending,onClick:async()=>{w(null);try{await M.mutateAsync({tracker:{azure:{organization:l,project:c}}}),await R()}catch{}},children:"Save and test"})]}),k?b.jsx(Et,{tone:k.ok?"success":"danger",children:k.message}):null]})]})]})]})}function JLe(e){return e.toLowerCase().trim().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,80)}function e$e(){const e=mi(),{toast:t}=Do(),[n,r]=C.useState(""),[i,o]=C.useState(""),[s,a]=C.useState(null),[l,u]=C.useState(null),[c,f]=C.useState(!1),[h,d]=C.useState(!1),[p,m]=C.useState(null),[y,g]=C.useState(""),[v,x]=C.useState(!0),[k,w]=C.useState(!1);C.useEffect(()=>{const A=setTimeout(()=>o(n),300);return()=>clearTimeout(A)},[n]),C.useEffect(()=>{let A=!1;return(async()=>{if(i!==void 0){f(!0),u(null);try{const P=sessionStorage.getItem("squad.console.token");if(!P)throw new $r;const M=await fetch(`/api/tracker/search?q=${encodeURIComponent(i)}`,{headers:{authorization:`Bearer ${P}`}});if(M.status===400){const E=await M.json();u(E.detail||E.error||"Search unavailable"),a(null);return}if(!M.ok){u(`HTTP ${M.status}`),a(null);return}const _=await M.json();if(A)return;_.ok&&_.results?a(_.results):(a([]),_.detail&&u(_.detail))}catch(P){A||u(P.message)}finally{A||f(!1)}}})(),()=>{A=!0}},[i]);function S(A){m(A),g(JLe(A.type??"imported")||"imported"),x(!0),d(!0)}async function O(){if(p){w(!0);try{const A=await Be("/api/tracker/import",{method:"POST",body:JSON.stringify({issueId:p.id,feature:y,withAttachments:v})});d(!1);const P=`${A.feature}/${A.id}`;t({tone:"success",title:"Imported as story",description:P}),e({to:"/stories/$feature/$id",params:{feature:A.feature,id:A.id}})}catch(A){u(A.message)}finally{w(!1)}}}return b.jsxs(Fe,{title:"Tracker",description:"Search Jira / Azure issues and import as stories. Configure the tracker in Config and credentials in Secrets.",children:[b.jsx("div",{className:"max-w-2xl",children:b.jsx(ut,{leftSlot:b.jsx(BC,{size:14}),placeholder:"Search issues…",value:n,onChange:A=>r(A.target.value)})}),l&&!c&&b.jsx(Ge,{tone:"warning",title:"Search",children:l}),c&&b.jsx("div",{className:"space-y-2",children:Array.from({length:4}).map((A,P)=>b.jsx(Nr,{className:"h-9"},P))}),!c&&s&&s.length===0&&!l&&b.jsx(Ge,{tone:"info",children:"No results. Try a different query or check tracker configuration."}),!c&&s&&s.length>0&&b.jsx("ul",{className:"overflow-hidden rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)]",children:s.map((A,P)=>b.jsxs("li",{className:`flex items-center gap-3 border-[var(--color-border)] px-3 py-[var(--space-row-y)] text-[13px] ${P>0?"border-t":""}`,children:[b.jsx("a",{href:A.url,target:"_blank",rel:"noreferrer",className:"w-24 shrink-0 font-mono text-[12px] text-[var(--color-accent)] hover:underline",children:A.id}),b.jsx("span",{className:"min-w-0 flex-1 truncate text-[var(--color-text)]",children:A.title}),b.jsxs(Et,{tone:"default",children:[A.type??"—"," · ",A.status??"—"]}),b.jsx(be,{type:"button",size:"sm",onClick:()=>S(A),children:"Import"})]},A.id))}),b.jsxs("p",{className:"text-[12px] text-[var(--color-text-dim)]",children:["Configure the tracker in"," ",b.jsx(ln,{to:"/config",className:"text-[var(--color-accent)] underline",children:"Config"})," ","and credentials in"," ",b.jsx(ln,{to:"/secrets",className:"text-[var(--color-accent)] underline",children:"Secrets"}),"."]}),b.jsx(Sc,{open:h,onClose:()=>d(!1),title:"Import as story",footer:b.jsxs("div",{className:"flex w-full flex-wrap justify-end gap-2",children:[b.jsx(be,{type:"button",variant:"secondary",onClick:()=>d(!1),children:"Cancel"}),b.jsx(be,{type:"button",onClick:O,disabled:k||!y.trim(),loading:k,children:"Import"})]}),children:b.jsxs("div",{className:"space-y-3 text-sm",children:[b.jsxs("p",{children:["Issue: ",p?.id," — ",p?.title]}),b.jsxs("label",{className:"block text-[var(--color-text-muted)]",children:["Feature slug",b.jsx(ut,{className:"mt-1",value:y,onChange:A=>g(A.target.value)})]}),b.jsxs("label",{className:"flex items-center gap-2",children:[b.jsx("input",{type:"checkbox",checked:v,onChange:A=>x(A.target.checked)}),"Download attachments"]})]})})]})}function t$e(e){return{ok:"var(--color-ok)",warn:"var(--color-warn)",fail:"var(--color-fail)",skip:"var(--color-text-dim)"}[e]}function n$e(e){return{ok:"success",warn:"warning",fail:"danger",skip:"default"}[e]}function r$e(){const[e,t]=C.useState(null),[n,r]=C.useState({}),[i,o]=C.useState(!1),[s,a]=C.useState(!1),[l,u]=C.useState(null);async function c(f){u(null),f?a(!0):o(!0);try{const h=await Be(f?"/api/doctor/fix":"/api/doctor",{method:f?"POST":"GET"});t(h)}catch(h){u(h.message)}finally{o(!1),a(!1)}}return b.jsxs(Fe,{title:"Doctor",description:"Graphical view of the same checks as `squad doctor`.",actions:b.jsx(be,{type:"button",onClick:()=>void c(!1),loading:i,leftIcon:b.jsx(wQ,{size:14}),children:"Run checks"}),children:[l?b.jsx(Ge,{tone:"danger",children:l}):null,i&&!e&&b.jsx("div",{className:"space-y-2",children:Array.from({length:12}).map((f,h)=>b.jsx(Nr,{className:"h-10 w-full"},h))}),e&&b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex flex-wrap gap-3 text-[13px]",children:[b.jsxs(Et,{tone:"success",children:[e.summary.ok," ok"]}),b.jsxs(Et,{tone:"warning",children:[e.summary.warn," warn"]}),b.jsxs(Et,{tone:"danger",children:[e.summary.fail," fail"]}),b.jsxs(Et,{tone:"default",children:[e.summary.skip," skip"]})]}),b.jsx(nt,{variant:"flat",className:"p-0 overflow-hidden",children:b.jsx("ul",{children:e.checks.map(f=>b.jsxs("li",{className:"border-t border-[var(--color-border)] first:border-t-0",children:[b.jsxs("button",{type:"button",className:"flex w-full items-start gap-3 px-3 py-3 text-left transition-colors hover:bg-[var(--gray-4)]",onClick:()=>r(h=>({...h,[f.id]:!h[f.id]})),children:[b.jsx("span",{"aria-hidden":!0,style:{background:t$e(f.status)},className:"mt-1 h-2 w-2 shrink-0 rounded-full"}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Et,{tone:n$e(f.status),children:f.status}),b.jsx("span",{className:"text-[13px] font-medium",children:f.name})]}),n[f.id]&&f.detail?b.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-words text-[12px] text-[var(--color-text-muted)]",children:f.detail}):null]})]}),f.fixable&&f.status==="warn"?b.jsx("div",{className:"px-3 pb-3",children:b.jsx(be,{variant:"secondary",size:"sm",onClick:()=>void c(!0),loading:s,leftIcon:b.jsx(SQ,{size:14}),children:"Apply repair"})}):null]},f.id+f.name))})})]})]})}const dD=[{inputTokens:12e3,outputTokens:2e3,durationMs:14200},{inputTokens:8200,outputTokens:1100,durationMs:9400},{inputTokens:15e3,outputTokens:3200,durationMs:22e3}];function i$e(){const{design:e}=Vd({from:"/__design"}),{toast:t}=Do(),n=Vv();return e!=="1"?b.jsx(Fe,{title:"Design playground",description:"Internal only — add the query param to view.",children:b.jsxs(Ge,{tone:"info",children:["Append ",b.jsx(Fi,{children:"design=1"})," to the URL to open the internal design playground."]})}):b.jsxs(Fe,{title:"Design playground",description:"Internal: every primitive on one page. Visit /__design?design=1.",children:[b.jsx(nt,{header:"Buttons",children:b.jsxs("div",{className:"flex flex-wrap gap-3",children:[b.jsx(be,{children:"Primary"}),b.jsx(be,{variant:"secondary",children:"Secondary"}),b.jsx(be,{variant:"ghost",leftIcon:b.jsx($C,{size:14}),children:"Ghost"}),b.jsx(be,{variant:"danger",leftIcon:b.jsx(Nh,{size:14}),children:"Danger"}),b.jsx(be,{loading:!0,children:"Loading"}),b.jsx(be,{size:"sm",children:"Small"})]})}),b.jsx(nt,{header:"Badges",children:b.jsx("div",{className:"flex flex-wrap gap-2",children:["default","success","warning","danger","info"].map(r=>b.jsx(Et,{tone:r,dot:!0,children:r},r))})}),b.jsx(nt,{header:"Callouts",children:b.jsx("div",{className:"space-y-2",children:["default","info","success","warning","danger"].map(r=>b.jsxs(Ge,{tone:r,title:`${r} callout`,children:["This is the body of a ",r," callout."]},r))})}),b.jsx(nt,{header:"Inputs",children:b.jsxs("div",{className:"space-y-3",children:[b.jsx(Ct,{label:"Name",helper:"Lowercase only.",children:({id:r,helperId:i})=>b.jsx(ut,{id:r,"aria-describedby":i,placeholder:"story-id"})}),b.jsx(Ct,{label:"Search",helper:"Optional.",children:({id:r})=>b.jsx(ut,{id:r,leftSlot:b.jsx(BC,{size:14}),placeholder:"Find issues…"})}),b.jsxs(ac,{defaultValue:"anthropic",children:[b.jsx("option",{value:"anthropic",children:"Anthropic"}),b.jsx("option",{value:"openai",children:"OpenAI"}),b.jsx("option",{value:"google",children:"Google"})]})]})}),b.jsx(nt,{header:"Toast & Confirm",children:b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx(be,{onClick:()=>t({title:"Saved",tone:"success"}),children:"Show toast"}),b.jsx(be,{variant:"danger",onClick:async()=>{const r=await n({title:"Delete?",description:"This cannot be undone.",tone:"danger"});t({title:r?"Confirmed":"Cancelled"})},children:"Confirm…"})]})}),b.jsxs(nt,{header:"Tabs / Skeleton / Spinner / Kbd / Tooltip / IconButton",children:[b.jsx(sP,{tabs:[{id:"one",label:"Tab one",panel:b.jsx("p",{children:"Panel one"})},{id:"two",label:"Tab two",panel:b.jsx(Nr,{className:"h-9 w-1/2"})}]}),b.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[b.jsx(Hv,{}),b.jsx(Fi,{children:"⌘"}),b.jsx(Fi,{children:"K"}),b.jsx(jg,{label:"Hello",children:b.jsx("span",{className:"text-sm",children:"Hover me"})}),b.jsx(wk,{icon:b.jsx(Nh,{size:14}),label:"Trash"})]})]}),b.jsx(nt,{header:"Charts (sample data)",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[b.jsx(qz,{ratio:.74}),b.jsx("div",{className:"min-w-0 flex-1 basis-[min(100%,240px)]",children:b.jsx(Gz,{runs:dD})}),b.jsx("div",{className:"min-w-0 flex-1 basis-[min(100%,240px)]",children:b.jsx(Kz,{runs:dD})})]})})]})}const dl=Eq({component:QQ});function pl(e,t){return wc({getParentRoute:()=>dl,path:e,component:t})}const o$e=pl("/",aSe),s$e=pl("/stories",cSe),a$e=wc({getParentRoute:()=>dl,path:"/stories/$feature/$id",component:oEe}),l$e=pl("/plans",uEe),u$e=wc({getParentRoute:()=>dl,path:"/plans/$feature/$planFile",component:cEe}),c$e=wc({getParentRoute:()=>dl,path:"/plans/$feature/diff",validateSearch:e=>({a:typeof e.a=="string"?e.a:"",b:typeof e.b=="string"?e.b:""}),component:mEe}),f$e=wc({getParentRoute:()=>dl,path:"/generate",validateSearch:e=>({feature:typeof e.feature=="string"?e.feature:"",storyId:typeof e.storyId=="string"?e.storyId:""}),component:xEe}),h$e=pl("/config",YLe),d$e=pl("/secrets",ZLe),p$e=pl("/tracker",e$e),m$e=pl("/doctor",r$e),g$e=wc({getParentRoute:()=>dl,path:"/__design",validateSearch:e=>({design:typeof e.design=="string"?e.design:void 0}),component:i$e}),y$e=dl.addChildren([o$e,s$e,a$e,l$e,u$e,c$e,f$e,h$e,d$e,p$e,m$e,g$e]),v$e=Fq({routeTree:y$e});function b$e(){return b.jsx("div",{className:"flex min-h-screen flex-col bg-[var(--color-bg)] px-6 py-12 text-[var(--color-text)]",children:b.jsx(Fe,{title:"Session not available",description:"The console must be opened with a fresh link from the CLI.",children:b.jsxs(Ge,{tone:"warning",title:"Session expired",children:[b.jsxs("p",{children:["The console URL must include a fresh token from the terminal. Run ",b.jsx(Fi,{children:"squad console"})," again and open the link it prints (or paste ",b.jsx(Fi,{children:"?t=…"})," into the address bar)."]}),b.jsxs("p",{className:"mt-2 text-[var(--color-text-dim)]",children:["If you closed the terminal, start ",b.jsx(Fi,{children:"squad console"})," from your project root."]})]})})})}const x$e=new CV({defaultOptions:{queries:{staleTime:5e3,retry:1,refetchOnWindowFocus:!1}}}),CO=document.getElementById("root");if(!CO)throw new Error("missing #root");const w$e=Hq();w$e?yw(CO).render(b.jsx(C.StrictMode,{children:b.jsx(AV,{client:x$e,children:b.jsx(DQ,{children:b.jsxs(MQ,{children:[b.jsx(Uq,{router:v$e}),b.jsx(AQ,{}),b.jsx(jQ,{})]})})})})):yw(CO).render(b.jsx(C.StrictMode,{children:b.jsx(b$e,{})}));